Transaction.EnlistPromotableSinglePhase 方法

定义

对资源管理器进行登记,该资源管理器具有使用可提升的单阶段登记 (PSPE) 的内部事务。

重载

EnlistPromotableSinglePhase(IPromotableSinglePhaseNotification)

对资源管理器进行登记,该资源管理器具有使用可提升的单阶段登记 (PSPE) 的内部事务。

EnlistPromotableSinglePhase(IPromotableSinglePhaseNotification, Guid)

对资源管理器进行登记,该资源管理器具有使用可提升的单阶段登记 (PSPE) 的内部事务。

EnlistPromotableSinglePhase(IPromotableSinglePhaseNotification)

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

对资源管理器进行登记,该资源管理器具有使用可提升的单阶段登记 (PSPE) 的内部事务。

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

参数

promotableSinglePhaseNotification
IPromotableSinglePhaseNotification

由参与者实现的 IPromotableSinglePhaseNotification 接口。

返回

描述登记的 SinglePhaseEnlistment 接口实现。

注解

事务中的登记是可变的;也就是说,它们不会在参与者失败后幸存下来。 此外,此方法仅建议事务管理器升级控制,但无法保证升级本身。 如果升级失败,则不会通知用户,事务将回滚。

参数 promotableSinglePhaseNotification 用于向事务管理器传达尝试提交资源管理器的内部事务的结果。 如果报告了不一致的数据,事务管理器将引发异常。 InDoubt如果报告结果,事务管理器在其自己的内部登记中查找结果通知,并忽略报告的响应。

有关事务登记和升级的详细信息,请参阅 事务管理升级。 有关 PSPE 的详细信息,请参阅 使用单阶段提交和可提升单阶段通知进行优化

适用于

EnlistPromotableSinglePhase(IPromotableSinglePhaseNotification, Guid)

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

对资源管理器进行登记,该资源管理器具有使用可提升的单阶段登记 (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 接口。

promoterType
Guid

分布式事务处理器的类型。

返回

描述登记的 SinglePhaseEnlistment 接口实现。

注解

如果为 promoterType 参数 TransactionInterop.PromoterTypeDtc指定的值为 ,则事务 必须由 MSDTC 升级,并且 byte[]IPromotableSinglePhaseNotification.Promote 方法返回的 必须是 MSDTC 事务传播令牌。

如果为 promoterType 参数指定的值 TransactionInterop.PromoterTypeDTC为 ,则 MSDTC 不会升级事务,而是由调用方实现 的 IPromotableSinglePhaseNotification。 如果此调用成功,则会对事务执行一组后续操作,这些操作将返回 TransactionPromotionException。 这些操作包括:

  • Transaction.EnlistDurable

  • TransactionInterop.GetDtcTransaction

  • TransactionInterop.GetExportCookie

  • TransactionInterop.GetTransmitterPropagationToken

  • Transaction 对象的序列化

适用于