Transaction::TransactionCompleted Event

 

Indicates that the transaction is completed.

Namespace:   System.Transactions
Assembly:  System.Transactions (in System.Transactions.dll)

public:
event TransactionCompletedEventHandler^ TransactionCompleted {
	void add(TransactionCompletedEventHandler^ value);
	void remove(TransactionCompletedEventHandler^ value);
}

Exception Condition
ObjectDisposedException

An attempt to subscribe this event on a transaction that has been disposed.

You can register for this event instead of using a volatile enlistment to get outcome information for transactions. The parameter passed to the TransactionCompletedEventHandler delegate is a Transaction instance. You can then query the TransactionInformation property of the specific instance to get an instance of TransactionInformation, whose Status property contains the status of a transaction with either the Committed or Aborted value.

Caution   Signing up for this event negatively affects the performance of the transaction it is attached to.

The following sample shows how an application can obtain the outcome of a transaction by subscribing to the TransactionCompleted event.

No code example is currently available or this language may not be supported.

.NET Framework
Available since 2.0
Return to top
Show: