语言

Transaction.SetDistributedTransactionIdentifier 方法

定义

设置非 MSDTC 升级程序生成的分布式事务标识符。

public:
 void SetDistributedTransactionIdentifier(System::Transactions::IPromotableSinglePhaseNotification ^ promotableNotification, Guid distributedTransactionIdentifier);
public void SetDistributedTransactionIdentifier(System.Transactions.IPromotableSinglePhaseNotification promotableNotification, Guid distributedTransactionIdentifier);
member this.SetDistributedTransactionIdentifier : System.Transactions.IPromotableSinglePhaseNotification * Guid -> unit
Public Sub SetDistributedTransactionIdentifier (promotableNotification As IPromotableSinglePhaseNotification, distributedTransactionIdentifier As Guid)

参数

promotableNotification
IPromotableSinglePhaseNotification

IPromotableSinglePhaseNotification参与者实现的接口。

distributedTransactionIdentifier
Guid

分布式事务管理器使用的事务的标识符。

注解

只能在处理该方法时 IPromotableSinglePhaseNotification.Promote 成功调用此方法。 如果在任何其他时间调用此方法,则会引发 a TransactionException 。

参数的 promotableNotification 指定值必须是最初指定给调用的 Transaction.EnlistPromotableSinglePhase 同一对象。 如果不是这种情况,则会引发一个 InvalidOperationException 。

适用于