RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TMtsAutoObject.SetAbort Method

Allows the MTS Automation object to be deactivated and aborts any current transactions.

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

Call SetAbort to indicate that any current transaction that includes the MTS Automation object to abort. If MTS started a transaction automatically, the transaction aborts when the current method call exits. If the MTS Automation object was enlisted in a pre-existing transaction, the client transaction will eventually fail. Usually, SetAbort is called in the except block of a try...except statement. 

In addition to aborting any current transaction, SetAbort indicates that the MTS Automation object can be deactivated when the current interface call exits. This means that state information is not preserved for the next time and the client calls the Automation object's interface. To prevent transactions from committing successfully without losing state information, use the DisableCommit method instead.

Tip: Call SetAbort at the beginning of a method to protect your MTS data module from committing prematurely in the event of an unexpected return. If the method call finishes normally, calling 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!