次の方法で共有


Event Notifications

The provider can support transaction outcome event notification by exposing IConnectionPointContainer on the session object. The consumer can expose the ITransactionOutcomeEvents interface to receive notification from the provider when a transaction is committed or aborted.

To receive event notifications, the consumer must implement the methods in ITransactionOutcomeEvents and register the interface with the provider's connection point mechanism. To do this, the consumer calls QueryInterface to request an IConnectionPointContainer interface pointer on the session, obtains the IConnectionPoint interface for IID_ITRANSACTIONOUTCOMEEVENT, and passes its ITransactionOutcomeEvents interface to that connection point. When a transaction is committed or aborted, the provider notifies each registered ITransactionOutcomeEvents interface of the outcome of the transaction.

For more information about ITransactionOutcomeEvents interface and its methods, see the Microsoft Distributed Transaction Coordinator Programmer's Reference. For more information about IConnectionPoint and IConnectionPointContainer, see the COM reference documentation.