Transaction.EnlistDurable Method
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Enlists a durable resource manager to participate in a transaction.
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. |
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.
- 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);
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
.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 |
- 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);
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
.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 |
Comentários do .NET
O .NET é um projeto código aberto. Selecione um link para fornecer comentários: