ContextUtil.SetAbort メソッド

定義

COM+ コンテキストの consistent ビットを false に、done ビットを true に設定します。

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

例外

使用できる COM+ コンテキストはありません。

次のコード例では、このメソッドの使用方法を示します。

// Commit or abort the transaction 
if (AllowCommit)
{
    ContextUtil::SetComplete();
}
else
{
    ContextUtil::SetAbort();
}
// Commit or abort the transaction
if (commit)
{
    ContextUtil.SetComplete();
}
else
{
    ContextUtil.SetAbort();
}
' Commit or abort the transaction 
If commit Then
    ContextUtil.SetComplete()
Else
    ContextUtil.SetAbort()
End If

注釈

要求された場合、コンテキストは現在のトランザクションを中止することを投票し、メソッドの戻り時にオブジェクトは非アクティブ化されます。

適用対象