Transaction.EnlistDurable 方法

定義

登記長期資源管理員以參與交易。

多載

EnlistDurable(Guid, IEnlistmentNotification, EnlistmentOptions)

登記支援兩階段交易認可 (Two-Phase Commit) 的長期資源管理員以參與交易。

EnlistDurable(Guid, ISinglePhaseNotification, EnlistmentOptions)

登記支援單一階段交易認可最佳化的長期資源管理員以參與交易。

備註

注意

這個方法會使用 LinkDemand 來防止從不受信任的程式碼呼叫它;不過,只有立即呼叫端才能擁有 FullTrust 許可權集合。

EnlistDurable(Guid, IEnlistmentNotification, EnlistmentOptions)

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

登記支援兩階段交易認可 (Two-Phase Commit) 的長期資源管理員以參與交易。

public:
 System::Transactions::Enlistment ^ EnlistDurable(Guid resourceManagerIdentifier, System::Transactions::IEnlistmentNotification ^ enlistmentNotification, System::Transactions::EnlistmentOptions enlistmentOptions);
public System.Transactions.Enlistment EnlistDurable (Guid resourceManagerIdentifier, System.Transactions.IEnlistmentNotification enlistmentNotification, System.Transactions.EnlistmentOptions enlistmentOptions);
member this.EnlistDurable : Guid * System.Transactions.IEnlistmentNotification * System.Transactions.EnlistmentOptions -> System.Transactions.Enlistment
Public Function EnlistDurable (resourceManagerIdentifier As Guid, enlistmentNotification As IEnlistmentNotification, enlistmentOptions As EnlistmentOptions) As Enlistment

參數

resourceManagerIdentifier
Guid

資源管理員的唯一識別項,其應該在整個資源管理員失敗或重新開機期間持續。

enlistmentNotification
IEnlistmentNotification

實作 IEnlistmentNotification 介面以接收兩階段交易認可告知的物件。

enlistmentOptions
EnlistmentOptions

如果資源管理員想要在準備階段執行額外的工作,即為 EnlistDuringPrepareRequired

傳回

描述登錄的 Enlistment 物件。

備註

具有長期登記的資源管理員必須能夠在遇到失敗時執行復原。 如需復原的詳細資訊,請參閱 執行復原。 如需有關變動性與持久性資源以及如何登記資源的詳細資訊,請參閱實作 A Resource Manager。 如需資源管理員如何回應認可通知,並在兩階段認可中準備認可的詳細資訊,請參閱 在Single-Phase和多階段認可交易

透過此方法登記參與交易的資源管理員會收到兩個階段認可通知,這些通知會對應至介面上 IEnlistmentNotification 定義的方法。

適用於

EnlistDurable(Guid, ISinglePhaseNotification, EnlistmentOptions)

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

登記支援單一階段交易認可最佳化的長期資源管理員以參與交易。

public:
 System::Transactions::Enlistment ^ EnlistDurable(Guid resourceManagerIdentifier, System::Transactions::ISinglePhaseNotification ^ singlePhaseNotification, System::Transactions::EnlistmentOptions enlistmentOptions);
public System.Transactions.Enlistment EnlistDurable (Guid resourceManagerIdentifier, System.Transactions.ISinglePhaseNotification singlePhaseNotification, System.Transactions.EnlistmentOptions enlistmentOptions);
member this.EnlistDurable : Guid * System.Transactions.ISinglePhaseNotification * System.Transactions.EnlistmentOptions -> System.Transactions.Enlistment
Public Function EnlistDurable (resourceManagerIdentifier As Guid, singlePhaseNotification As ISinglePhaseNotification, enlistmentOptions As EnlistmentOptions) As Enlistment

參數

resourceManagerIdentifier
Guid

資源管理員的唯一識別項,其應該在整個資源管理員失敗或重新開機期間持續。

singlePhaseNotification
ISinglePhaseNotification

實作 ISinglePhaseNotification 介面的物件,該介面必須可以接收單一階段交易認可和兩階段交易認可告知。

enlistmentOptions
EnlistmentOptions

如果資源管理員想要在準備階段執行額外的工作,即為 EnlistDuringPrepareRequired

傳回

描述登錄的 Enlistment 物件。

備註

具有長期登記的資源管理員必須能夠在遇到失敗時執行復原。 如需復原的詳細資訊,請參閱 執行復原。 如需有關變動性與持久性資源以及如何登記資源的詳細資訊,請參閱實作 A Resource Manager

您應該注意,即使您的資源管理員實作使用此方法登記,也不保證它會收到單一階段認可。 交易管理員仍然可以改為傳送兩個階段認可通知。 如需單一階段認可優化的詳細資訊,請參閱 使用單一階段認可優化和可提升單一階段通知

適用於