MessageQueueTransaction.Begin 方法

定義

開始新的訊息佇列內部交易。Begins a new Message Queuing internal transaction.

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

例外狀況

已經啟動交易。The transaction has already been started.

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

備註

Begin標示將認可或回復的處理開始, 視交易是否成功而定。Begin marks the start of processing that will be committed or rolled back, depending on the success of the transaction. 如果在處理期間發生例外狀況, 則會回復整個交易。If an exception occurs during processing, the entire transaction is rolled back. 這包括呼叫Begin之後傳送或接收的所有訊息。This includes all messages sent or received after the 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.

適用於

另請參閱