MessageQueueTransaction.Commit 方法

定义

提交正挂起的内部事务。Commits a pending internal transaction.

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

异常

尚未开始正尝试提交的事务。The transaction you are trying to commit has not started.

发生内部消息队列错误。An internal Message Queuing error occurs.

注解

Commit标记在对的调用Begin后开始处理的成功完成。Commit marks the successful completion of processing begun at a call to Begin. 如果调用Begin和对的Commit调用之间发生异常, 则将回滚整个事务。If an exception occurs between the call the Begin and the call to Commit, the entire transaction is rolled back. 这包括调用Begin后发送或接收的所有消息。This includes all messages sent or received after the call to Begin.

通常, 一种方式是在Begin Try...Catch异常处理块中调用, 并AbortTry子句中放置Commit对的调用, 并在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.

适用于

另请参阅