共用方式為


Transaction Propagation

 

Applies To: Windows 10, Windows 7, Windows 8, Windows 8.1, Windows Server 2008, Windows Server 2008 R2, Windows Server 2012, Windows Server 2012 R2, Windows Server Technical Preview, Windows Vista

A transaction begun in one process can be propagated to another process. Resource managers built on a client/server architecture have a server side and a client side. The server side enlists in a transaction so that it can participate in the two-phase commit. However, because the DTC transaction might have been initiated on the client side, client/server resource managers use a DTC-implemented mechanism to propagate a transaction from the client side to the server side.

To propagate a transaction, the resource manager proxy on the client side provides a function that an application can call to request a resource manager to enlist in a transaction. After obtaining the transaction to enlist in, the resource manager proxy uses ITransactionExport to propagate the transaction to the transaction coordinator.

To export a transaction

  1. The application client obtains an ITransaction interface by invoking the ITransactionDispenser::BeginTransaction method.

  2. The application client calls the IResourceManager2::Enlist2 method, passing it the transaction in which it wants the resource manager to enlist.

  3. Within the IResourceManager2::Enlist2 method, the resource manager proxy does the following:

After the resource manager server receives the transaction cookie, it invokes ITransactionImport::Import, providing it with the cookie that it received from its proxy. This invocation translates the cookie to an ITransaction interface, and if it succeeds, the resource manager has an interface to the client-initiated transaction.

See Also

Obtaining the Transaction Dispenser from a Transaction
Obtaining the Whereabouts of the Participating DTC