Nested Transactions with DBXIDA
Nested Transactions with DBXIDA
Hi;
After opening the connection, I can see FSupportsNestedTrans = True. But I can't take advantage from nested transactions.
First I start a transaction with a special ID=10
Then I run:
CDS1.ApplyUpdates ...
CDS2.ApplyUpdates ...
CDS3.ApplyUpdates ...
if one of that ApplyUpdates(0) 0 I break the process and then I rollback the transaction ID=10.
This process worked fine with some drivers, but I can't make it running now.
What can it be?
Thank you
Dany
After opening the connection, I can see FSupportsNestedTrans = True. But I can't take advantage from nested transactions.
First I start a transaction with a special ID=10
Then I run:
CDS1.ApplyUpdates ...
CDS2.ApplyUpdates ...
CDS3.ApplyUpdates ...
if one of that ApplyUpdates(0) 0 I break the process and then I rollback the transaction ID=10.
This process worked fine with some drivers, but I can't make it running now.
What can it be?
Thank you
Dany
Well, this is a very bad notice for me. Nested transactions are very necesary, and more if we use ClientDataSet->DataSetProvider->SQLDataset->SQLConnection because there are lots of situations in were we have to update more than one Dataset and we need the whole process to work as only one block.
Firebird, Oracle, and PostresSQL supports nested transactions; please tell me if I have any way of tacking advantage of that in any way. Otherwise, is very dificult to use Devarts DBX drivers.
Dany
Firebird, Oracle, and PostresSQL supports nested transactions; please tell me if I have any way of tacking advantage of that in any way. Otherwise, is very dificult to use Devarts DBX drivers.
Dany
Hi;
StarMyTransaction;
try
ClientDataSet1.ApplyUpdate(0) 0 then raise Excep ....
ClientDataSet2.ApplyUpdate(0) 0 then raise Excep ....
ClientDataSet3.ApplyUpdate(0) 0 then raise Excep ....
CommiMyTransaction;
except
on exception do RollbackMyTransaction;
end;
If, for example, ClientDataSet 3 raises the error, I expect a rollback of what I did in ClientDataSets 1 and 2; but it is not working. Both are saved on the database.
My approach worked fine with before, using other drivers.
Dany
Well, this is exactly what I am trying to do, but it does not work. For example:Plash wrote:If you open a transaction manually, ApplyUpdates is executed in this transaction. You can call ApplyUpdates for all datasets, then commit the transaction.
StarMyTransaction;
try
ClientDataSet1.ApplyUpdate(0) 0 then raise Excep ....
ClientDataSet2.ApplyUpdate(0) 0 then raise Excep ....
ClientDataSet3.ApplyUpdate(0) 0 then raise Excep ....
CommiMyTransaction;
except
on exception do RollbackMyTransaction;
end;
If, for example, ClientDataSet 3 raises the error, I expect a rollback of what I did in ClientDataSets 1 and 2; but it is not working. Both are saved on the database.
My approach worked fine with before, using other drivers.
Dany