Transaction.EnlistPromotableSinglePhase 方法

定义

对资源管理器进行登记,该资源管理器具有使用可提升的单阶段登记 (PSPE) 的内部事务。Enlists a resource manager that has an internal transaction using a promotable single phase enlistment (PSPE).

重载

EnlistPromotableSinglePhase(IPromotableSinglePhaseNotification, Guid)

对资源管理器进行登记,该资源管理器具有使用可提升的单阶段登记 (PSPE) 的内部事务。Enlists a resource manager that has an internal transaction using a promotable single phase enlistment (PSPE).

EnlistPromotableSinglePhase(IPromotableSinglePhaseNotification)

对资源管理器进行登记,该资源管理器具有使用可提升的单阶段登记 (PSPE) 的内部事务。Enlists a resource manager that has an internal transaction using a promotable single phase enlistment (PSPE).

EnlistPromotableSinglePhase(IPromotableSinglePhaseNotification, Guid)

对资源管理器进行登记,该资源管理器具有使用可提升的单阶段登记 (PSPE) 的内部事务。Enlists a resource manager that has an internal transaction using a promotable single phase enlistment (PSPE).

public:
 bool EnlistPromotableSinglePhase(System::Transactions::IPromotableSinglePhaseNotification ^ promotableSinglePhaseNotification, Guid promoterType);
public bool EnlistPromotableSinglePhase (System.Transactions.IPromotableSinglePhaseNotification promotableSinglePhaseNotification, Guid promoterType);
member this.EnlistPromotableSinglePhase : System.Transactions.IPromotableSinglePhaseNotification * Guid -> bool
Public Function EnlistPromotableSinglePhase (promotableSinglePhaseNotification As IPromotableSinglePhaseNotification, promoterType As Guid) As Boolean

参数

promotableSinglePhaseNotification
IPromotableSinglePhaseNotification

由参与者实现的 IPromotableSinglePhaseNotification 接口。A IPromotableSinglePhaseNotification interface implemented by the participant.

promoterType
Guid

分布式事务处理器的类型。The type of the distributed transaction processor.

返回

描述登记的 SinglePhaseEnlistment 接口实现。A SinglePhaseEnlistment interface implementation that describes the enlistment.

注解

如果promoterTypeTransactionInterop.PromoterTypeDtc参数指定的值为,则必须 IPromotableSinglePhaseNotification.Promote由 msdtc 提升事务,并且从方法byte[]返回的必须是 msdtc 事务传播标记。If the value specified for the promoterType parameter is TransactionInterop.PromoterTypeDtc, the transaction must be promoted by MSDTC and the byte[] returned from the IPromotableSinglePhaseNotification.Promote method must be an MSDTC transaction propagation token.

如果为promoterType参数指定的值TransactionInterop.PromoterTypeDTC是,则不会由 MSDTC 提升事务, IPromotableSinglePhaseNotification而是由调用方的实现来提升。If the value specified for the promoterType parameter is notTransactionInterop.PromoterTypeDTC, the transaction will not be promoted by MSDTC, but rather by the caller's implementation of IPromotableSinglePhaseNotification. 如果此调用成功,将在事务上包含一组后续操作,该操作将返回TransactionPromotionExceptionIf this call is successful, there is a set of subsequent operations on the transaction that will return a TransactionPromotionException. 这些操作包括:These operations are:

  • Transaction.EnlistDurable

  • TransactionInterop.GetDtcTransaction

  • TransactionInterop.GetExportCookie

  • TransactionInterop.GetTransmitterPropagationToken

  • 事务对象的序列化Serialization of a Transaction object

EnlistPromotableSinglePhase(IPromotableSinglePhaseNotification)

对资源管理器进行登记,该资源管理器具有使用可提升的单阶段登记 (PSPE) 的内部事务。Enlists a resource manager that has an internal transaction using a promotable single phase enlistment (PSPE).

public:
 bool EnlistPromotableSinglePhase(System::Transactions::IPromotableSinglePhaseNotification ^ notification);
public bool EnlistPromotableSinglePhase (System.Transactions.IPromotableSinglePhaseNotification notification);
member this.EnlistPromotableSinglePhase : System.Transactions.IPromotableSinglePhaseNotification -> bool
Public Function EnlistPromotableSinglePhase (notification As IPromotableSinglePhaseNotification) As Boolean

参数

promotableSinglePhaseNotification
IPromotableSinglePhaseNotification

由参与者实现的 IPromotableSinglePhaseNotification 接口。A IPromotableSinglePhaseNotification interface implemented by the participant.

返回

描述登记的 SinglePhaseEnlistment 接口实现。A SinglePhaseEnlistment interface implementation that describes the enlistment.

注解

事务中的登记是可变的;也就是说,它们不会经受参与者的故障。Enlistments in a transaction are volatile; that is, they do not survive the failure of the participant. 此外,此方法仅建议事务管理器提升控制,但不保证升级本身。In addition, this method only suggests the transaction manager to escalate control, but the escalation itself is not guaranteed. 如果升级失败,则不会通知用户并回滚事务。If escalation fails, the user is not notified and the transaction is rolled back.

参数promotableSinglePhaseNotification用于与事务管理器进行通信,尝试提交资源管理器的内部事务的结果。The parameter promotableSinglePhaseNotification is used to communicate to the transaction manager the outcome of attempting to commit the resource manager's internal transaction. 如果报告的数据不一致,事务管理器将引发异常。If inconsistent data is reported, the transaction manager throws an exception. 如果报告InDoubt了结果,则事务管理器会在其自己的内部登记中查找结果通知,并忽略报告的响应。If an InDoubt outcome is reported, the transaction manager looks for the outcome notification in its own internal enlistment and ignores the reported response.

有关登记和事务升级的详细信息,请参阅事务管理升级For more information on enlistments and escalation of a transaction, please see Transaction Management Escalation. 有关 PSPE 的详细信息,请参阅使用单阶段提交和可提升的单阶段通知进行优化For more information on PSPE, see Optimization Using Single Phase Commit and Promotable Single Phase Notification.

注意此方法使用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.

适用于