Udostępnij za pośrednictwem


Obtaining the Whereabouts of the Participating DTC

 

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

Resource managers that are designed as client/server systems generally have the resource manager server on one node and the resource manager proxy on another node. If the application client begins a transaction and wants the resource manager to enlist in the transaction, it invokes a method in the resource manager proxy (such as IResourceManager2::Enlist2) and provides it with the ITransaction interface that it wants the resource manager to enlist in.

For example, if a transaction is begun on Node A, it needs to be propagated to the transaction coordinator on Node B before the resource manager on Node B can enlist in it. The resource manager proxy on Node A needs to ask its local DTC to propagate the transaction to Node B, but first it needs to know the location of the DTC that the transaction should be propagated to.

Note Even in cases where the resource manager proxy is on the same node as the resource manager, the steps for obtaining the DTC whereabouts and propagating the transaction need to be performed.

The resource manager takes the following steps to obtain the whereabouts of the participating DTC:

  1. Obtains the ITransactionImportWhereabouts interface—for example, by calling QueryInterface or by calling DtcGetTransactionManager.

  2. Calls ITransactionImportWhereabouts::GetWhereabouts to obtain the whereabouts of the DTC that it is working with. The resource manager can cache the obtained information, which is in the form of a binary large object (BLOB), to avoid repeated calls of this method.

The resource manager next sends the whereabouts to the resource manager proxy, which takes the following steps to obtain an ITransactionExport interface:

  1. Obtains the ITransactionExportFactory interface from the DTC proxy, by invoking QueryInterface.

  2. Invokes ITransactionExportFactory::Create, passing it the whereabouts BLOB received from the resource manager, and obtains an ITransactionExport interface to an export object, which it can keep for exporting transactions to the DTC with which its resource manager is working.