TransactionVote Enumeration
TOC
Collapse the table of content
Expand the table of content

TransactionVote Enumeration

 

Specifies the values allowed for transaction outcome voting.

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

[SerializableAttribute]
[ComVisibleAttribute(false)]
public enum TransactionVote

Member nameDescription
Abort

Aborts the current transaction.

Commit

Commits the current transaction.

This enumeration is used by the ContextUtil class.

The following code example demonstrates the use of this enumeration.

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

    }

}

.NET Framework
Available since 1.1
Return to top
Show:
© 2016 Microsoft