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 manager, System::Transactions::IEnlistmentNotification ^ notification, System::Transactions::EnlistmentOptions options);
public System.Transactions.Enlistment EnlistDurable (Guid manager, System.Transactions.IEnlistmentNotification notification, System.Transactions.EnlistmentOptions options);
member this.EnlistDurable : Guid * System.Transactions.IEnlistmentNotification * System.Transactions.EnlistmentOptions -> System.Transactions.Enlistment
Public Function EnlistDurable (manager As Guid, notification As IEnlistmentNotification, options 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.

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 manager, System::Transactions::ISinglePhaseNotification ^ notification, System::Transactions::EnlistmentOptions options);
public System.Transactions.Enlistment EnlistDurable (Guid manager, System.Transactions.ISinglePhaseNotification notification, System.Transactions.EnlistmentOptions options);
member this.EnlistDurable : Guid * System.Transactions.ISinglePhaseNotification * System.Transactions.EnlistmentOptions -> System.Transactions.Enlistment
Public Function EnlistDurable (manager As Guid, notification As ISinglePhaseNotification, options 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