RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TMtsAutoObject.DisableCommit Method

Prevents clients from completing transactions.

Pascal
procedure DisableCommit;
C++
__fastcall DisableCommit();

Call DisableCommit to indicate that the MTS Automation object cannot complete its current transaction or release state information until it receives further method invocations from the client. After calling DisableCommit, the current transaction (if any) cannot be completed until the MTS Automation object calls EnableCommit or SetComplete

With transactions that are started automatically when the MTS Automation object's interface is called, DisableCommit is not necessary. These transactions are not committed until the MTS Automation object calls SetComplete. However, when the MTS Automation object is enlisted in a transaction that was started previously, the client controls the transaction and can attempt to commit it before the MTS Automation object has completed its part. Calling DisableCommit prevents the client from prematurely committing a transaction. If a client tries to commit a transaction after the MTS Automation object has called DisableCommit, the transaction aborts.

Tip: Call DisableCommit at the beginning of a method to protect your MTS Automation object from committing prematurely in the event of an unexpected return. If the method call finishes normally, calling EnableCommit or SetComplete reverses this affect and allows the transaction to complete.
 

 

Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
What do you think about this topic? Send feedback!