InTransaction problem when database links are involved

sergio.sette

Member²
I have a TOracleDataset working on a join between two tables, the first one belonging to the database where i'm connected to, the second one is a table in another database i access through a database link.
The dataset is just opened, non changes are made but the TOracleSession InTransaction method allways returns true.
Is this the correct behaviour in or i'm doing something wrongs.

Best regards

sergio sette
 
This is indeed the "correct" behavior. The Oracle Server implicitly starts a transaction whenever you access a database link. As far as I know there is nothing you can do about that.
 
As far as I know there is nothing you can do about that. [/QB]
Hi Marco,

i have a quite trivial problem. In a form i have a grid where i can modify the data of a dataset. I can modify more record in the same transaction. I use an action for testing the transaction status. The base idea is that InTransaction should return true only if there are pending changes and normally this works fine. With database link i can have an open transaction without actually having pending changes. The questions are :

- is there a way to know is the transacion is read only

- is there any drawback if after opening the dataset i commit the transaction (i.e. in an afterPost event?)

Best regards

sergio sette
 
is there a way to know is the transacion is read only
Not that I know.
is there any drawback if after opening the dataset i commit the transaction (i.e. in an afterPost event?)
There may be a problem fetching additional records, so TOracleDataSet.QueryAllRecords should be set to True. You can commit in the TOracleDataSet.AfterQuery event, which occurs after the last record has been fetched.
 
Back
Top