Partager via


IResourceManagerRejoinable::Rejoin

 

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

The Rejoin method re-enlists a resource manager to an in-doubt transaction after a database restarts due to an error. Rejoin can be called when Reenlist cannot due to IResourceManager::ReenlistmentComplete already being called for an IResourceManager or IResourceManager2 instance.

Syntax

  
    HRESULT Rejoin( byte     *pRepInfo,   
ULONG    cbPrepInfo,   
DWORD    ITimeout,   
XACTSTAT *pXactStat);  

Parameters

pRepInfo
[in] A binary BLOB that contains the prepare information previously obtained from the enlistment object and written into the resource manager's log.

cbPrepInfo
[in] The length of pPrepInfo, in bytes.

ITimeout
[in] The amount of time the resource manager is willing to wait for the outcome of a transaction, in milliseconds. 0x0, defined as XACTCONST_TIMEOUTINFINITE, is the infinite time-out value.

pXactStat
[out] The status of the transaction, which is provided by the transaction manager. The possible values are:

  • XACTSTAT_ABORTED

  • XACTSTAT_COMMITTED

Return Values

S_OK
Success.

E_INVALIDARG
One or more arguments are invalid.

E_OUTOFMEMORY
Unable to allocate memory.

E_UNEXPECTED
Something unexpected occurred.

XACT_E_CONNECTION_DOWN
Lost connection with the transaction manager.

XACT_E_REENLISTTIMEOUT
The re-enlist request timed out. XACTSTAT_NONE is returned via *pXactStat when this error occurs.

Remarks

A resource manager that uses a single IResourceManager or IResourceManager2 instance to connect to MSDTC for multiple resource manager logs can use Rejoin if any of the logs has in-doubt transactions.

After an IResourceManager or IResourceManager2 instance is created, the resource manager searches the resource manager logs for in-doubt transactions. Reenlist should then be called for each in-doubt transaction to determine the outcome. When the outcomes of the in-doubt transactions are logged, IResourceManager::ReenlistmentComplete should be called to notify MSDTC that the resource manager has no more in-doubt transactions and MSDTC no longer needs to store the transaction outcomes.

Once IResourceManager::ReenlistmentComplete is called, IResourceManager::Reenlist can no longer be called to retrieve transaction outcomes. However, transactions that weren't previously in-doubt can still be processed. If an error causes any of those logs to go offline during the processing, they can return as in-doubt transactions. Obtaining the outcome of the new in-doubt transactions with IResourceManager::Reenlist isn't possible at this point because IResourceManager::ReenlistmentComplete was already called. In this case, Rejoin can be called to obtain the outcomes of the transactions and MSDTC will store the outcomes until IResourceManager::ReenlistmentComplete is called again. This prevents the need for the resource manager to create a new IResourceManager or IResourceManager2 instance that restarts and reconnects to MSDTC.

Requirements

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

Platforms: Windows Server 2016

Header: Declared in TxDtc.h