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.

傳回

Boolean

SinglePhaseEnlistment 介面實作,可描述此登記。A SinglePhaseEnlistment interface implementation that describes the enlistment.

備註

如果為參數指定的值 promoterTypeTransactionInterop.PromoterTypeDtc ,則交易 必須 由 msdtc 升級,而 byte[] 從方法傳回的 IPromotableSinglePhaseNotification.Promote 必須 是 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 不是not TransactionInterop.PromoterTypeDTC ,則不會由 MSDTC 升級交易,而是由呼叫端的實值進行升級 IPromotableSinglePhaseNotificationIf 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 ^ promotableSinglePhaseNotification);
public:
 bool EnlistPromotableSinglePhase(System::Transactions::IPromotableSinglePhaseNotification ^ notification);
public bool EnlistPromotableSinglePhase (System.Transactions.IPromotableSinglePhaseNotification promotableSinglePhaseNotification);
public bool EnlistPromotableSinglePhase (System.Transactions.IPromotableSinglePhaseNotification notification);
member this.EnlistPromotableSinglePhase : System.Transactions.IPromotableSinglePhaseNotification -> bool
member this.EnlistPromotableSinglePhase : System.Transactions.IPromotableSinglePhaseNotification -> bool
Public Function EnlistPromotableSinglePhase (promotableSinglePhaseNotification As IPromotableSinglePhaseNotification) As Boolean
Public Function EnlistPromotableSinglePhase (notification As IPromotableSinglePhaseNotification) As Boolean

參數

promotableSinglePhaseNotificationnotification
IPromotableSinglePhaseNotification

參與者所實作的 IPromotableSinglePhaseNotification 介面。A IPromotableSinglePhaseNotification interface implemented by the participant.

傳回

Boolean

SinglePhaseEnlistment 介面實作,可描述此登記。A SinglePhaseEnlistment interface implementation that describes the enlistment.

備註

交易中的登記為 volatile;也就是說,它們無法承受參與者的失敗。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 可用來與交易管理員進行通訊,以嘗試認可 resource manager 的內部交易結果。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.

適用於