Condividi tramite


IDtcToXaMapper::EnlistResourceManager

 

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

Instructs the DTC Proxy to enlist on behalf of the XA resource manager. The EnlistResourceManager method must be called for every transaction that the connection is requested to be enlisted in. This interface method should be called after the XA resource manager has the XID.

When called, a message is sent to the XA TM module in DTC, which then enlists with the DTC TM module. At the time of two-phase commit, this enlistment receives the prepare, commit, and abort messages which the XA TM module translates into appropriate XA function calls such as xa_prepare, xa_commit, and xa_abort.

If this method fails, the ODBC driver must call ReleaseResourceManager using the cookie specified in dwRMCookie.

Syntax

  
HRESULT EnlistResourceManager (   DWORD dwRMCookie,  DWORD * pdwITransaction);  

Parameters

dwRMCookie
[in] A cookie representing the RM which was obtained from the call to RequestNewResourceManager.

pdwITransaction
[in] A pointer to the ITransaction interface which the application passes in as a value for the SQL_ENLIST_IN_DTC connection attribute.

Return Values

S_OK
Success.

E_FAIL
TM enlisted failed.

E_INVALIDARG
One or more of the parameters are not valid.

E_OUTOFMEMORY
Unable to do a new enlistment.

E_UNEXPECTED
An unexpected error occurred.

XACT_E_CONNECTION_DENIED
The transaction manager refused to accept a connection.

XACT_E_CONNECTION_DOWN
Lost connection with DTC TM.

XACT_E_LOGFULL
TM has run out of log space.

XACT_E_NOTRANSACTION
No transaction corresponding to pdwITransaction.

Requirements

For an explanation of the requirement values, see Requirements (Component Services).

Platforms: Windows Server 2016, Windows 10, Windows Server 2012 R2, Windows 8.1, Windows Server 2012, Windows 8, Windows Server 2008 R2, Windows 7, Windows Server 2008, Windows Vista

Header: Declared in oletx2xa.h

See Also

IDtcToXaHelperFactory
IDtcToXaHelper
IDtcToXaHelperSinglePipe