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

Nota

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)

Source:
Transaction.cs
Source:
Transaction.cs
Source:
Transaction.cs

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);

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

.NET 9 e outras versões
Produto Versões
.NET Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1

EnlistDurable(Guid, ISinglePhaseNotification, EnlistmentOptions)

Source:
Transaction.cs
Source:
Transaction.cs
Source:
Transaction.cs

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);

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

.NET 9 e outras versões
Produto Versões
.NET Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1