RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TMtsDataModule.SetAbort Method

Allows the MTS data module 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 data module should abort. If MTS or COM+ started a transaction automatically (because the data module requires one), that transaction aborts when the current method call exits. If the MTS data module was enlisted in a pre-existing transaction, the client transaction will eventually fail. Usually, SetAbort is called in the except block of a try..exceptstatement. 

In addition to aborting any current transaction, SetAbort indicates that the MTS data module can be deactivated when the current interface call exits. This means that state information is not preserved for the next time the client calls the data module'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) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!