Coordinated Transactions

If the provider can participate in coordinated transactions, it supports ITransactionJoin on the session. The consumer calls QueryInterface on ITransactionJoin to determine whether the provider supports coordinated transactions. The consumer uses this interface to enlist the session in a coordinated transaction. Once the consumer has joined a coordinated transaction, it calls the ITransaction interface of the transaction coordinator to commit or abort the transaction. If the consumer calls ITransaction::Commit or ITransaction::Abort on the transaction coordinator with the fRetaining flag set to TRUE, the transaction commits or aborts, ITransaction remains valid, and the session remains enlisted in the transaction. Calling ITransaction::Commit or ITransaction::Abort with the fRetaining flag set to FALSE commits or aborts the transaction, ITransaction becomes invalid, and the session is no longer part of a coordinated transaction.

It is an error to call ITransactionJoin::JoinTransaction if the session is already participating in either a local or coordinated transaction.

If the consumer calls ITransactionLocal::StartTransaction to begin a local transaction while in a coordinated transaction, that new transaction acts as a nested transaction within the coordinated transaction.