英語で読む

次の方法で共有


TransactionVote 列挙型

定義

トランザクションの結果判定に使用できる値を指定します。

C#
[System.Runtime.InteropServices.ComVisible(false)]
[System.Serializable]
public enum TransactionVote
継承
TransactionVote
属性

フィールド

名前 説明
Abort 1

現在のトランザクションを中止します。

Commit 0

現在のトランザクションをコミットします。

次のコード例では、この列挙体の使用方法を示します。

C#
[Transaction]
public class TransactionalComponent : ServicedComponent
{

    public void TransactionalMethod (string data)
    {

      ContextUtil.DeactivateOnReturn = true;
      ContextUtil.MyTransactionVote = TransactionVote.Abort;

      // Do work with data. Return if any errors occur.

      // Vote to commit. If any errors occur, this code will not execute.
      ContextUtil.MyTransactionVote = TransactionVote.Commit;
    }
}

注釈

この列挙は、ContextUtil クラスで使用します。

適用対象

製品 バージョン
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1