ContextUtil.DisableCommit 方法
定义
在 COM+ 上下文中将 consistent 位和 done 位设置为 false。Sets both the consistent bit and the done bit to false in the COM+ context.
public:
static void DisableCommit();
public static void DisableCommit ();
static member DisableCommit : unit -> unit
Public Shared Sub DisableCommit ()
例外
没有 COM+ 上下文可用。No COM+ context is available.
示例
下面的代码示例调用 DisableCommit 方法。The following code example calls the DisableCommit method.
[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 + 上下文会投票中止当前事务,但不会在方法返回时停用该对象。If asked, the COM+ context votes to abort the current transaction, but the object is not deactivated on method return.