MessageQueueTransaction.Commit Method ()

 

Commits a pending internal transaction.

Namespace:   System.Messaging
Assembly:  System.Messaging (in System.Messaging.dll)

public void Commit()

Exception Condition
InvalidOperationException

The transaction you are trying to commit has not started.

MessageQueueException

An internal Message Queuing error occurs.

Commit marks the successful completion of processing begun at a call to Begin. If an exception occurs between the call the Begin and the call to Commit, the entire transaction is rolled back. This includes all messages sent or received after the call to Begin.

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.

.NET Framework
Available since 1.1
Return to top
Show: