Transaction.SetDistributedTransactionIdentifier 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
設定由非 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 同一物件。 若非如此,則擲出 a InvalidOperationException 。