TransactionVote Enumeration


The .NET API Reference documentation has a new home. Visit the .NET API Browser on to see the new experience.

Specifies the values allowed for transaction outcome voting.

Namespace:   System.EnterpriseServices
Assembly:  System.EnterpriseServices (in System.EnterpriseServices.dll)

public enum TransactionVote

Member nameDescription

Aborts the current transaction.


Commits the current transaction.

This enumeration is used by the ContextUtil class.

The following code example demonstrates the use of this enumeration.

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;



.NET Framework
Available since 1.1
Return to top