Transaction.EnlistDurable Transaction.EnlistDurable Transaction.EnlistDurable Transaction.EnlistDurable Method

定义

登记持久资源管理器以参与事务。Enlists a durable resource manager to participate in a transaction.

重载

EnlistDurable(Guid, IEnlistmentNotification, EnlistmentOptions) EnlistDurable(Guid, IEnlistmentNotification, EnlistmentOptions) EnlistDurable(Guid, IEnlistmentNotification, EnlistmentOptions) EnlistDurable(Guid, IEnlistmentNotification, EnlistmentOptions)

登记支持两阶段提交的持久资源管理器以参与事务。Enlists a durable resource manager that supports two phase commit to participate in a transaction.

EnlistDurable(Guid, ISinglePhaseNotification, EnlistmentOptions) EnlistDurable(Guid, ISinglePhaseNotification, EnlistmentOptions) EnlistDurable(Guid, ISinglePhaseNotification, EnlistmentOptions) EnlistDurable(Guid, ISinglePhaseNotification, EnlistmentOptions)

登记支持单阶段提交优化的持久资源管理器以参与事务。Enlists a durable resource manager that supports single phase commit optimization to participate in a transaction.

注解

注意此方法使用LinkDemand来防止不受信任的代码调用; 但是,只有直接调用方才能FullTrust拥有权限集。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) EnlistDurable(Guid, IEnlistmentNotification, EnlistmentOptions) EnlistDurable(Guid, IEnlistmentNotification, EnlistmentOptions) 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

参数

resourceManagerIdentifier
Guid Guid Guid Guid

资源管理器的唯一标识符,它应该在资源管理器失败或重新启动的过程中持久保留。A unique identifier for a resource manager, which should persist across resource manager failure or reboot.

enlistmentNotification
IEnlistmentNotification IEnlistmentNotification IEnlistmentNotification IEnlistmentNotification

实现 IEnlistmentNotification 接口以接收两阶段提交通知的对象。An object that implements the IEnlistmentNotification interface to receive two phase commit notifications.

enlistmentOptions
EnlistmentOptions EnlistmentOptions EnlistmentOptions EnlistmentOptions

如果资源管理器在准备阶段想要执行额外工作,则为 EnlistDuringPrepareRequiredEnlistDuringPrepareRequired if the resource manager wants to perform additional work during the prepare phase.

返回

描述登记的 Enlistment 对象。An Enlistment object that describes the enlistment.

注解

如果具有持久登记的资源管理器遇到失败,则必须能够执行恢复。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.

通过此方法登记以参与事务的资源管理器接收两阶段提交通知,它们对应于IEnlistmentNotification接口上定义的方法。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) EnlistDurable(Guid, ISinglePhaseNotification, EnlistmentOptions) EnlistDurable(Guid, ISinglePhaseNotification, EnlistmentOptions) 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

参数

resourceManagerIdentifier
Guid Guid Guid Guid

资源管理器的唯一标识符,它应该在资源管理器失败或重新启动的过程中持久保留。A unique identifier for a resource manager, which should persist across resource manager failure or reboot.

singlePhaseNotification
ISinglePhaseNotification ISinglePhaseNotification ISinglePhaseNotification ISinglePhaseNotification

实现 ISinglePhaseNotification 接口的对象,该对象必须能够接收单阶段提交和两阶段提交通知。An object that implements the ISinglePhaseNotification interface that must be able to receive single phase commit and two phase commit notifications.

enlistmentOptions
EnlistmentOptions EnlistmentOptions EnlistmentOptions EnlistmentOptions

如果资源管理器在准备阶段想要执行额外工作,则为 EnlistDuringPrepareRequiredEnlistDuringPrepareRequired if the resource manager wants to perform additional work during the prepare phase.

返回

描述登记的 Enlistment 对象。An Enlistment object that describes the enlistment.

注解

如果具有持久登记的资源管理器遇到失败,则必须能够执行恢复。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.

适用于