MessageQueueTransaction.Abort 方法

定義

復原暫止的內部交易。Rolls back the pending internal transaction.

public:
 void Abort();
public void Abort ();
member this.Abort : unit -> unit
Public Sub Abort ()

例外狀況

您要復原的內部交易尚未啟動。The internal transaction you are attempting to roll back has not started.

發生內部訊息佇列錯誤。An internal Message Queuing error occurs.

備註

Abort將在呼叫Begin時開始的處理常式標記為不成功。Abort marks the unsuccessful completion of a process begun at a call to Begin.

一般來說, 一個Begin會呼叫Try...Catch例外狀況處理區塊內的Commit , 將Try呼叫放Abort入子句中, 並在Catch子句中呼叫。Typically, one makes a call to Begin within a Try...Catch exception-handling block, putting a call to Commit in the Try clause, and a call to Abort in the Catch clause.

Abort回復整個交易。Abort rolls back the entire transaction. 這包括呼叫Begin之後傳送或接收的所有訊息。This includes all messages sent or received after the call to Begin.

適用於

另請參閱