ContextUtil::IsInTransaction Property

 

Gets a value that indicates whether the current context is transactional.

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

public:
property bool IsInTransaction {
	static bool get();
}

Property Value

Type: System::Boolean

true if the current context is transactional; otherwise, false.

Exception Condition
COMException

There is no COM+ context available.

The following code example gets the value of a IsInTransaction property.

[Transaction(TransactionOption::Required)]
public ref class ContextUtil_IsInTransaction: public ServicedComponent
{
public:
   void Example()
   {
      // Display whether the current COM+ context is enlisted in a
      // transaction.
      Console::WriteLine( "Current context enlisted in transaction: {0}", 
         ContextUtil::IsInTransaction );
   }
};

.NET Framework
Available since 1.1
Return to top
Show: