語言

ContextUtil.EnableCommit 方法

定義

在 COM+ 情境中,將位元設consistent為 ,true位done元為 。false

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

例外狀況

目前沒有 COM+ 的上下文。

範例

以下程式碼範例呼叫該 EnableCommit 方法。

[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

備註

若被要求,COM+ 上下文會提交目前的交易,但物件不會在方法回傳時被停用。

適用於