Page 1 of 1

Using Transactions

Posted: Thu 22 May 2008 12:36
by chkaufmann
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

Posted: Thu 22 May 2008 13:07
by Challenger
Please refer to the "Working with transactions" topiс in UniDAC Help.