System.Win.Mtsobj.TMtsAutoObject.DisableCommit

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

procedure DisableCommit;

C++

void __fastcall DisableCommit();

Properties

Type Visibility Source Unit Parent
procedure
function
public
System.Win.Mtsobj.pas
System.Win.Mtsobj.hpp
System.Win.Mtsobj TMtsAutoObject

Description

Prevents clients from completing transactions.

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.

See Also