TransactionVote Enum

Definition

Specifies the values allowed for transaction outcome voting.

C#
[System.Runtime.InteropServices.ComVisible(false)]
[System.Serializable]
public enum TransactionVote
Inheritance
TransactionVote
Attributes

Fields

Name Value Description
Commit 0

Commits the current transaction.

Abort 1

Aborts the current transaction.

Examples

The following code example demonstrates the use of this enumeration.

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;
    }
}

Remarks

This enumeration is used by the ContextUtil class.

Applies to

Product Versions
.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