This topic has not yet been rated - Rate this topic

IResourceManager::Enlist

The Enlist method enlists a resource manager in a transaction.

HRESULT Enlist( 
  ITransaction * pTransaction,  ITransactionResourceAsync * pRes,  XACTUOW * pUOW,  LONG * pisoLevel,  ITransactionEnlistmentAsync ** ppEnlist);
pTransaction
[in] Pointer to the transaction object in which the resource manager wants to enlist.

pRes
[in] Pointer to the resource manager's ITransactionResourceAsync interface. The resource manager developer must implement the methods on this interface.

pUOW
[out] Pointer to the transaction identifier GUID.

pisoLevel
[out] Pointer to the value of the client specified isolation level.

ppEnlist
[out] Reference to the ITransactionEnlistmentAsync interface on the enlistment object.

S_OK
Success.

E_INVALIDARG
One or more parameters were invalid.

E_OUTOFMEMORY
Unable to allocate memory.

E_UNEXPECTED
Something unexpected happened.

XACT_E_ABORT
The transaction has aborted.

XACT_E_CONNECTION_DOWN
Lost connection with the transaction manager.

XACT_E_NOTRANSACTION
For some reason, the transaction could not be found. Perhaps it was not exported, or it could have been aborted and forgotten before the enlist call was made.

XACT_E_LOGFULL
Unable to enlist as the LOG is full.

XACT_E_TOOMANY_ENLISTMENTS
The coordinator already has the maximum number of resources enlisted in the transaction. The maximum number of resources that can be enlisted in a transaction is 32. Typically, coordinators should not have an arbitrary limit as to the maximum number of enlistments they can support.

An instance of ITransactionResourceAsync is passed as an argument. This interface is implemented by the resource manager, and there is an instance of it per transaction enlistment. If the coordinator is successful in enlisting the resource manager on the requested transaction, the resource manager receives an instance of ITransactionEnlistmentAsync as an out parameter to the Enlist method.

It is important to remember that an ITransaction instance is being provided to the method as an argument. However, the transaction in the general case would have been begun by the application. The resource manager somehow needs to obtain that transaction from the client before it can request to be enlisted in it. In brief, the application calls a function or invokes a method in the resource manager proxy, asking it to enlist in the transaction. The resource manager proxy, with the help of DTC proxy, is then responsible for propagating the transaction to the resource manager server.

For an explanation of the requirement values, see Requirements.

Platforms: Windows 2000, Windows XP, Windows Server 2003

Header: Declared in txdtc.h

Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ