ContextUtil.DisableCommit 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
在 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+ 上下文會投票中止目前交易,但物件不會在方法回傳時被停用。