语言

ContextUtil.DisableCommit 方法

定义

在 consistent COM+ 上下文中设置位和 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+ 上下文投票终止当前事务,但在方法返回时不会停用该对象。

适用于