다음을 통해 공유


IDtcToXaMapper::RequestNewResourceManager

 

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

This method obtain a RM cookie which is stored in the connection object. The RequestNewResourceManager method is invoked only once per ODBC connection. It is not required after the connection transitions from the local transaction state to the distributed transaction state.

An ODBC connection can be in one of two states, distributed transaction state, or non-distributed transaction state as shown in the Transaction States topic.

Syntax

  
HRESULT RequestNewResourceManager(   CHAR * pszDSN,  CHAR * pszClientDllName,  DWORD * pdwRMCookie);  

Parameters

pszDSN
[in] A string containing the Data Source Name (DSN).

The maximum size of this string is 3,072 characters. Prior to Windows Server 2016 and Windows 10 the maximum size is 256 characters; larger strings would cause the call to fail with E_FAIL.

pszClientDllName
[in] A string containing the name of the resource manager's client DLL.

pdwRMCookie
[in/out] A cookie representing the RM corresponding to the DSN is returned via this parameter.

Return Values

S_OK
Success.

E_FAIL
The attempt to create the resource manager failed due to a bad installation of the XA TM or the DTC TM or the size of the string pointed to by the pszDSN parameter is too large.

E_INVALIDARG
One or more of the parameters are not valid.

E_OUTOFMEMORY
Unable to allocate resources for a new resource manager.

E_UNEXPECTED
An unexpected error occurred.

XACT_E_CONNECTION_DOWN
Lost connection with DTC TM.

XACT_E_TMNOTAVAILABLE
Unable to establish a connection with DTC service.Failure—the TMs log is full.

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