共用方式為


ContextUtil.DisableCommit 方法

定義

在 COM+ 內容中將 consistent 位元和 done 位元都設定為 false

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

例外狀況

沒有 COM+ 內容可供使用。

範例

下列程式代碼範例會呼叫 DisableCommit 方法。

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

備註

如果系統詢問,COM+ 內容會投票中止目前的交易,但在方法傳回時不會停用物件。

適用於