Transaction.EnlistPromotableSinglePhase 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
使用可提升單一階段登記 (PSPE) 來登記具有內部交易的資源管理員。
多載
EnlistPromotableSinglePhase(IPromotableSinglePhaseNotification) |
使用可提升單一階段登記 (PSPE) 來登記具有內部交易的資源管理員。 |
EnlistPromotableSinglePhase(IPromotableSinglePhaseNotification, Guid) |
使用可提升單一階段登記 (PSPE) 來登記具有內部交易的資源管理員。 |
EnlistPromotableSinglePhase(IPromotableSinglePhaseNotification)
使用可提升單一階段登記 (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)
使用可提升單一階段登記 (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 物件的串行化
適用於
意見反應
https://aka.ms/ContentUserFeedback。
即將登場:在 2024 年,我們將逐步淘汰 GitHub 問題作為內容的意見反應機制,並將它取代為新的意見反應系統。 如需詳細資訊,請參閱:提交並檢視相關的意見反應