Transaction.EnlistDurable Method

Definition

Enlists a durable resource manager to participate in a transaction.

Overloads

EnlistDurable(Guid, IEnlistmentNotification, EnlistmentOptions)

Enlists a durable resource manager that supports two phase commit to participate in a transaction.

EnlistDurable(Guid, ISinglePhaseNotification, EnlistmentOptions)

Enlists a durable resource manager that supports single phase commit optimization to participate in a transaction.

Remarks

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.

EnlistDurable(Guid, IEnlistmentNotification, EnlistmentOptions)

Enlists a durable resource manager that supports two phase commit to participate in a transaction.

public:
 System::Transactions::Enlistment ^ EnlistDurable(Guid resourceManagerIdentifier, System::Transactions::IEnlistmentNotification ^ enlistmentNotification, System::Transactions::EnlistmentOptions enlistmentOptions);
public System.Transactions.Enlistment EnlistDurable (Guid resourceManagerIdentifier, System.Transactions.IEnlistmentNotification enlistmentNotification, System.Transactions.EnlistmentOptions enlistmentOptions);
member this.EnlistDurable : Guid * System.Transactions.IEnlistmentNotification * System.Transactions.EnlistmentOptions -> System.Transactions.Enlistment
Public Function EnlistDurable (resourceManagerIdentifier As Guid, enlistmentNotification As IEnlistmentNotification, enlistmentOptions As EnlistmentOptions) As Enlistment

Parameters

resourceManagerIdentifier
Guid

A unique identifier for a resource manager, which should persist across resource manager failure or reboot.

enlistmentNotification
IEnlistmentNotification

An object that implements the IEnlistmentNotification interface to receive two phase commit notifications.

enlistmentOptions
EnlistmentOptions

EnlistDuringPrepareRequired if the resource manager wants to perform additional work during the prepare phase.

Returns

An Enlistment object that describes the enlistment.

Remarks

Resource managers with a durable enlistment must be able to perform recovery if they experience a failure. For more information on recovery, see Performing Recovery. For more information on volatile and durable resources, as well as how to enlist a resource, see Implementing A Resource Manager. For more information on how a resource manager responds to commit notification and prepare the commit in two-phase commit, see Committing A Transaction In Single-Phase and Multi-Phase.

Resource managers enlisted for participation in a transaction through this method receive two phase commit notifications that correspond to the methods defined on the IEnlistmentNotification interface.

Applies to

EnlistDurable(Guid, ISinglePhaseNotification, EnlistmentOptions)

Enlists a durable resource manager that supports single phase commit optimization to participate in a transaction.

public:
 System::Transactions::Enlistment ^ EnlistDurable(Guid resourceManagerIdentifier, System::Transactions::ISinglePhaseNotification ^ singlePhaseNotification, System::Transactions::EnlistmentOptions enlistmentOptions);
public System.Transactions.Enlistment EnlistDurable (Guid resourceManagerIdentifier, System.Transactions.ISinglePhaseNotification singlePhaseNotification, System.Transactions.EnlistmentOptions enlistmentOptions);
member this.EnlistDurable : Guid * System.Transactions.ISinglePhaseNotification * System.Transactions.EnlistmentOptions -> System.Transactions.Enlistment
Public Function EnlistDurable (resourceManagerIdentifier As Guid, singlePhaseNotification As ISinglePhaseNotification, enlistmentOptions As EnlistmentOptions) As Enlistment

Parameters

resourceManagerIdentifier
Guid

A unique identifier for a resource manager, which should persist across resource manager failure or reboot.

singlePhaseNotification
ISinglePhaseNotification

An object that implements the ISinglePhaseNotification interface that must be able to receive single phase commit and two phase commit notifications.

enlistmentOptions
EnlistmentOptions

EnlistDuringPrepareRequired if the resource manager wants to perform additional work during the prepare phase.

Returns

An Enlistment object that describes the enlistment.

Remarks

Resource managers with a durable enlistment must be able to perform recovery if they experience a failure. For more information on recovery, see Performing Recovery. For more information on volatile and durable resources, as well as how to enlist a resource, see Implementing A Resource Manager.

You should note that even when your resource manager implementation enlists with this method, it is not guaranteed that it receives a single phase commit. The transaction manager can still send two phase commit notifications instead. For more information on the single phase commit optimization, see Optimization Using Single Phase Commit and Promotable Single Phase Notification.

Applies to