I have a question regarding using transactions. I create all components from scratch:
conn := TUniConnection.Create(nil);
trans := TUniTransaction.Create(nil);
qry1 := TUniQuery.Create(nil);
qry1.Connection := conn;
qry1.Transaction := trans;
qry2 := TUniQuery.Create(nil);
qry2.Connection := conn;
qry2.Transaction := trans;
My questions are:
1) should I call the StartTransaction/Commit methods of my TUniConnection or my TUniTransaction. What's the difference?
2) Many single calls to qry1.Execute and/or qry2.Execute are not wrapped in StartTransaction/Commit. I just let it be done by "AutoCommit".
When I do something with a large number of Execute calls. I wrap these calls in StartTransaction/Commit calls.
Will this work fine like this? Checking with the debugger, I think, even then, CommitRetaining is called after each Execute call. So can I change the AutoCommit Flag of a TUniQuery at runtime?
3) Is there a document about good practice to use transactions with UniDAC?
cu Christian
Using Transactions
-
- Devart Team
- Posts: 925
- Joined: Thu 17 Nov 2005 10:53