TransactionManager.Reenlist(Guid, Byte[], IEnlistmentNotification) 方法

定義

重新加入交易中的持久參與者。

public:
 static System::Transactions::Enlistment ^ Reenlist(Guid resourceManagerIdentifier, cli::array <System::Byte> ^ recoveryInformation, System::Transactions::IEnlistmentNotification ^ enlistmentNotification);
public static System.Transactions.Enlistment Reenlist(Guid resourceManagerIdentifier, byte[] recoveryInformation, System.Transactions.IEnlistmentNotification enlistmentNotification);
static member Reenlist : Guid * byte[] * System.Transactions.IEnlistmentNotification -> System.Transactions.Enlistment
Public Shared Function Reenlist (resourceManagerIdentifier As Guid, recoveryInformation As Byte(), enlistmentNotification As IEnlistmentNotification) As Enlistment

參數

resourceManagerIdentifier
Guid

A Guid 能唯一識別資源管理器。

recoveryInformation
Byte[]

包含更多復原資訊。

enlistmentNotification
IEnlistmentNotification

一個實作 IEnlistmentNotification 接收通知的資源物件。

傳回

Enlistment 就是描述入伍過程的。

例外狀況

recoveryInformation 無效。

-或-

交易管理員的 recoveryInformation 資訊與設定的交易管理器不符。

-或-

recoveryInformation 不被 System.Transactions識別。

RecoveryComplete(Guid) 已在指定 resourceManagerIdentifier時被呼叫。 續約申請被拒絕。

resourceManagerIdentifierrecoveryInformation指定的復原資訊內容不符。

備註

這很重要

使用不受信任的資料呼叫此方法存在安全風險。 只有在受信任的資料時才會呼叫此方法。 如需詳細資訊,請參閱 驗證所有輸入

資源管理員透過在資源故障後重新註冊交易參與者,協助解決交易中的持久性登記問題。

參數 resourceManagerIdentifier 用於在資源故障發生時,一致標示交易參與者。 呼叫Reenlist該方法時,資源管理器必須提供與最初EnlistDurable在登錄時呼叫該方法相同的resourceManagerIdentifier資料,否則會拋出 aTransactionException

當參與者使用此方法重新入隊時,會根據該方法的第二階段方法 IEnlistmentNotification (即 CommitRollback、 或 InDoubt )適當地被呼叫。

參與者成功重新入伍後,你應該打電話 RecoveryComplete 完成恢復。

你應該只在資源管理器失敗重啟時呼叫此方法。 在兩階段提交的初始準備階段期間,您應該只重新納入資源管理員所記錄的未解析的交易。 任何嘗試在無效時間呼叫這個方法都可能會產生錯誤的結果。

如果交易管理器失敗,且資源管理器在你呼叫 Prepared 該方法後不久才進行復原,該方法在 Two-Phase 提交協議第一階段的徵用後不久,資源管理器可能會收到 InDoubtRollback 調。

適用於