TransactionVote Enumeration

 
System_CAPS_noteNote

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

Specifies the values allowed for transaction outcome voting.

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

[SerializableAttribute]
[ComVisibleAttribute(false)]
public enum class 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.


[assembly:System::Reflection::AssemblyKeyFile("Transaction.snk")];
[Transaction]
public ref class TransactionalComponent: public ServicedComponent
{
public:
   void TransactionalMethod( String^ data )
   {
      ContextUtil::DeactivateOnReturn = true;
      ContextUtil::MyTransactionVote = TransactionVote::Abort;

      // do work with data
      ContextUtil::MyTransactionVote = TransactionVote::Commit;
   }

};

.NET Framework
Available since 1.1
Return to top
Show: