Udostępnij za pośrednictwem


IResourceManager::ReenlistmentComplete

 

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 resource manager calls the ReenlistmentComplete method after resolving all the in-doubt transactions it knows about.

Syntax

  
HRESULT ReenlistmentComplete(void);  
  

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_RECOVERYALREADYDONE
The ReenlistmentComplete method was called at least once after this interface was obtained. Therefore, the recovery is already complete.

Remarks

This method lets the coordinator forget any transactions that it was remembering; it had an obligation to remember those transactions until it was certain that the resource manager knew the outcome of those transactions. A resource manager forgets a transaction before responding to the second phase. This allows for an interval in which a resource manager would have forgotten a transaction but not the transaction manager. This window exists because the committed message from the resource manager to the coordinator can get lost on its way due to some fault. A coordinator would not know if the resource manager has received the commit notification or not, unless it receives the committed message from the resource manager. Until it receives the committed message, it cannot forget the transaction. The resource manager, when it reestablishes a relationship with the coordinator, queries the status for all the in-doubt transactions but does not ask for the transactions that it had already forgotten. After resolving all the in-doubt transactions, it simply calls IResourceManager::ReenlistmentComplete, which then lets the transaction manager forget the transactions.

Note

It is possible for a resource manager to experience an error that causes a transaction to become in-doubt after ReenlistmentComplete is called. If any transactions become in-doubt after ReenlistmentComplete is called, IResourceManagerRejoinable::Rejoin can be called to retrieve the transaction outcomes without needing to restart the resource manager and reconnect to the transaction manager.

This protocol lets the recovery process be repeated multiple times without affecting the outcome of transactions. Any number of failures can occur during recovery, but the results are always the same. This protocol also lets the resource managers enlist in new transactions while the in-doubt transactions are being resolved. The coordinator is able to discern between the new transactions and the old transactions. New transactions are the ones that the resource manager enlists in from the time when the new resource manager-to-coordinator relationship is established, and all the old transactions are those it had enlisted in prior to the establishment of the new relationship.

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 txdtc.h

See Also

IResourceManager2