Transaction Outcome Events

Applications can use the ITransactionOutcomeEvents interface to receive an asynchronous notice of a transaction's outcome. The application implements the methods in the ITransactionOutcomeEvents interface and registers the interface with the connection point mechanism. When MS DTC determines the outcome of a transaction, it calls the appropriate method in the ITransactionOutcomeEvents interface to inform the application of the outcome.

The ITransactionOutcomeEvents interface has the following methods.

Method Description
ITransactionOutcomeEvents
::Committed
Raised for committed transactions.
ITransactionOutcomeEvents
::Aborted
Raised for aborted transactions.
ITransactionOutcomeEvents
::HeuristicDecision
Raised when one of the participants in the transaction makes an heuristic decision to commit or abort the transaction. Heuristic decisions are not supported in the current release.
ITransactionOutcomeEvents
::InDoubt
Raised when the application calls either Commit or Abort and then loses communication with the commit coordinator before completion of phase one of the two-phase commit protocol.

    To use transaction outcome events, follow these steps
  1. Implement the methods in the ITransactionOutcomeEvents interface.
  2. Each time you initiate a new transaction, call the QueryInterface method on the transaction object with an riid of IID_IConnectionPointContainer to obtain the IConnectionPointContainer interface.
  3. Call the IConnectionPointContainer::FindConnectionPoint method with an riid of IID_ITransactionOutcomeEvents to obtain the IConnectionPoint that supports the ITransactionOutcomeEvents sink.
  4. Call the Release method on the IConnectionPointContainer interface.
  5. Call the Advise method on the IConnectionPoint interface and pass the pointer to the ITransactionOutcomeEvents interface that you implemented. Advise will return a Connection Key.
  6. When the transaction commits or aborts, MS DTC will call the appropriate ITransactionOutcomeEvents method to report the transaction's outcome.
  7. Call the Unadvise method on the IConnectionPoint interface and pass the Connection Key that was returned from Advise.
  8. Call the Release method on the IConnectionPoint interface.
  9. Call the Release method on the transaction object.

You must repeat steps 2 through 9 for each transaction for which you require transaction outcome notification.

For more information about: