Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Reenlist Method
Collapse the table of content
Expand the table of content

TransactionManager.Reenlist Method

Reenlists a durable participant in a transaction.

Namespace: System.Transactions
Assembly: System.Transactions (in system.transactions.dll)

public:
static Enlistment^ Reenlist (
	Guid resourceManagerIdentifier, 
	array<unsigned char>^ recoveryInformation, 
	IEnlistmentNotification^ enlistmentNotification
)
public static Enlistment Reenlist (
	Guid resourceManagerIdentifier, 
	byte[] recoveryInformation, 
	IEnlistmentNotification enlistmentNotification
)
public static function Reenlist (
	resourceManagerIdentifier : Guid, 
	recoveryInformation : byte[], 
	enlistmentNotification : IEnlistmentNotification
) : Enlistment
Not applicable.

Parameters

resourceManagerIdentifier

A Guid that uniquely identifies the resource manager.

recoveryInformation

Contains additional information of recovery information.

enlistmentNotification

A resource object that implements IEnlistmentNotification to receive notifications.

Return Value

An Enlistment that describes the enlistment.

Exception typeCondition

ArgumentException

recoveryInformation is invalid.

-or-

Transaction Manager information in recoveryInformation does not match the configured transaction manager.

-or-

RecoveryInformation is not recognized by System.Transactions.

InvalidOperationException

RecoveryComplete has already been called for the specified resourceManagerIdentifier. The reenlistment is rejected.

TransactionException

The resourceManagerIdentifier does not match the content of the specified recovery information in recoveryInformation.

A resource manager facilitates resolution of durable enlistments in a transaction by reenlisting the transaction participant after resource failure.

The resourceManagerIdentifier parameter is used to consistently label the participant of a transaction in the event of a resource failure. When calling the Reenlist method, the resource manager must provide the same resourceManagerIdentifier as it used when it originally called the EnlistDurable method during enlistment, or a TransactionException is thrown.

When a participant is reenlisted using this method, the phase 2 methods of IEnlistmentNotification that correspond to the transaction's outcome (that is, Commit , Rollback or InDoubt ) are called as appropriate.

After the participants are successfully reenlisted, you should then call RecoveryComplete to complete the recovery.

You should only call this method when a resource manager restarts from failure. In addition, you should only reenlist unresolved transactions logged by a resource manager during the initial Prepare phase of a two-phase commit. Any attempt to call this method at invalid times can produce erroneous results.

If the transaction manager fails, and your resource manager performs recovery only a short time after you called the Prepared method on an enlistment in phase 1 of the Two-Phase Commit protocol, your resource manager might either receive the InDoubt or Rollback callback.

For more information on recovery, see Performing Recovery.

Note   This method uses LinkDemand to prevent it from being called from untrusted code; however, only the immediate caller is required to possess the FullTrust permission set.

Windows 98, Windows Server 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0

Community Additions

ADD
Show:
© 2015 Microsoft