IDtcToXaHelper::TranslateTridToXid

 

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 is called to obtain an XID from an ITransaction interface pointer. The ODBC driver calls this method each time a connection is enlisted on a new transaction. The ITransaction pointer is offered by a transaction object. The transaction object contains a DTC transaction that is identified by a transaction identifier (TRID) which is a globally unique identifier (GUID). Given a TRID, one can always create an XID.

The XID should be stored in the connection object as it may be needed in the future. After obtaining the XID, the ODBC driver should issue an xa_start or its equivalent on the back-end resource manager to associate the XID with the connection.

Syntax

  
HRESULT TranslateTridToXid (   ITransaction * pITransaction,  GUID * pguidBqual,  XID * pXid);  

Parameters

pITransaction
[in] A pointer to the ITransaction object for the active DTC transaction that the XA resource manager wishes to enlist in.

pguidBqual
[in] A pointer to a GUID representing.

pXid
[out] A pointer to the caller allocated XID structure to receive the newly generated XID.

Return Values

S_OK
Success.

E_INVALIDARG
One or more of the parameters are not valid.

E_FAIL
Unable to generate a valid XID for this transaction. The generated GTRID or BQUAL was too large to fit in the XID structure.

E_UNEXPECTED
An unknown error occurred. No information is returned.

XACT_E_NOTRANSACTION
Unable to retrieve information for the transaction because it was already completed. No information is returned.

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

IDtcToXaMapper
IDtcToXaHelperFactory
IDtcToXaHelperSinglePipe