TransactionVote Enumeration


Specifies the values allowed for transaction outcome voting.

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

Public Enumeration 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.

<Transaction()>  _
Public Class TransactionalComponent
    Inherits ServicedComponent

    Public Sub TransactionalMethod(ByVal data As String) 

        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

    End Sub 'TransactionalMethod 
End Class 'TransactionalComponent

.NET Framework
Available since 1.1
Return to top