PreparingEnlistment.Prepared メソッドとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > PreparingEnlistment.Prepared メソッドの意味・解説 

PreparingEnlistment.Prepared メソッド

メモ : このメソッドは、.NET Framework version 2.0新しく追加されたものです。

トランザクションコミットできること示します

名前空間: System.Transactions
アセンブリ: System.Transactions (system.transactions.dll 内)
構文構文

解説解説
使用例使用例
Public Class EnlistmentClass
    Implements IEnlistmentNotification

    Public Sub Prepare(ByVal
 myPreparingEnlistment As PreparingEnlistment) Implements
 System.Transactions.IEnlistmentNotification.Prepare
        Console.WriteLine("Prepare notification received")

        'Perform transactional work

        'If work finished correctly, reply with prepared
        myPreparingEnlistment.Prepared()
    End Sub

    Public Sub Commit(ByVal
 myEnlistment As Enlistment) Implements System.Transactions.IEnlistmentNotification.Commit
        Console.WriteLine("Commit notification received")

        'Do any work necessary when commit notification is received

        'Declare done on the enlistment
        myEnlistment.Done()
    End Sub

    Public Sub Rollback(ByVal
 myEnlistment As Enlistment) Implements System.Transactions.IEnlistmentNotification.Rollback
        Console.WriteLine("Rollback notification received")

        'Do any work necessary when rollback notification is received

        'Declare done on the enlistment
        myEnlistment.Done()
    End Sub

    Public Sub InDoubt(ByVal
 myEnlistment As Enlistment) Implements System.Transactions.IEnlistmentNotification.InDoubt
        Console.WriteLine("In doubt notification received")

        'Do any work necessary when indout notification is received

        'Declare done on the enlistment
        myEnlistment.Done()
    End Sub
End Class
class myEnlistmentClass : IEnlistmentNotification
{
    public void Prepare(PreparingEnlistment
 preparingEnlistment)
    {
        Console.WriteLine("Prepare notification received");

        //Perform transactional work

        //If work finished correctly, reply prepared
        preparingEnlistment.Prepared();

        // otherwise, do a ForceRollback
        preparingEnlistment.ForceRollback();
    }

    public void Commit(Enlistment enlistment)
    {
        Console.WriteLine("Commit notification received");

        //Do any work necessary when commit notification is received

        //Declare done on the enlistment
        enlistment.Done();
    }

    public void Rollback(Enlistment enlistment)
    {
        Console.WriteLine("Rollback notification received");

        //Do any work necessary when rollback notification is received

        //Declare done on the enlistment
        enlistment.Done();
    }

    public void InDoubt(Enlistment enlistment)
    {
        Console.WriteLine("In doubt notification received");

        //Do any work necessary when indout notification is received
        
        //Declare done on the enlistment
        enlistment.Done();
    }
}
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
PreparingEnlistment クラス
PreparingEnlistment メンバ
System.Transactions 名前空間


このページでは「.NET Framework クラス ライブラリ リファレンス」からPreparingEnlistment.Prepared メソッドを検索した結果を表示しています。
Weblioに収録されているすべての辞書からPreparingEnlistment.Prepared メソッドを検索する場合は、下記のリンクをクリックしてください。
 全ての辞書からPreparingEnlistment.Prepared メソッド を検索

英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

「PreparingEnlistment.Prepared メソッド」の関連用語

PreparingEnlistment.Prepared メソッドのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



PreparingEnlistment.Prepared メソッドのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2025 Microsoft.All rights reserved.

©2025 GRAS Group, Inc.RSS