Datasnap.Win.MtsRdm.TMtsDataModule.SetAbort

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

procedure SetAbort;

C++

void __fastcall SetAbort();

Properties

Type Visibility Source Unit Parent
procedure
function
public
Datasnap.Win.MtsRdm.pas
Datasnap.Win.MtsRdm.hpp
Datasnap.Win.MtsRdm TMtsDataModule

Description

Allows the MTS data module to be deactivated and aborts any current transactions.

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.

See Also