Share via


ContextUtil.EnableCommit Metodo

Definizione

Imposta il bit consistent su true e il bit done su false nel contesto di COM+.

public:
 static void EnableCommit();
public static void EnableCommit ();
static member EnableCommit : unit -> unit
Public Shared Sub EnableCommit ()

Eccezioni

Non è disponibile alcun contesto COM+.

Esempio

Nell'esempio di codice seguente viene chiamato il EnableCommit metodo .

[Transaction(TransactionOption::Required)]
public ref class ContextUtil_EnableCommit: public ServicedComponent
{
public:
   void Example()
   {
      // Set the consistent bit to true and the done bit to false for the
      // current COM+ context.
      ContextUtil::EnableCommit();
   }
};
[Transaction(TransactionOption.Required)]
public class ContextUtil_EnableCommit : ServicedComponent
{
    public void Example()
    {
        // Set the consistent bit to true and the done bit to false for the
        // current COM+ context.
        ContextUtil.EnableCommit();
    }
}
<Transaction(TransactionOption.Required)>  _
Public Class ContextUtil_EnableCommit
    Inherits ServicedComponent
    
    Public Sub Example() 
        ' Set the consistent bit to true and the done bit to false for the
        ' current COM+ context.
        ContextUtil.EnableCommit()
    
    End Sub
End Class

Commenti

Se richiesto, il contesto COM+ eseguirà il commit della transazione corrente, ma l'oggetto non viene disattivato al ritorno del metodo.

Si applica a