NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

MessageQueue.CommitTransaction

Commits a pending internal transaction.

[Visual Basic]
Public Sub CommitTransaction()
[C#]
public void CommitTransaction();
[C++]
public: void CommitTransaction();
[JScript]
public function CommitTransaction();

Exceptions

Exception Type Condition
MessageQueueException The transaction you are trying to commit has not started.
MessageQueueException The attempt to retrieve queue information to commit the transaction generated an exception specified by the given status message.

Remarks

CommitTransaction marks the successful completion of processing begun at a call to BeginTransaction. If an exception occurs between the call to BeginTransaction and the call to CommitTransaction, the entire transaction is rolled back. This includes messages sent after the call to BeginTransaction. Messages that are part of a transaction must be sent to transactional queues.

Make the call to BeginTransaction within a Try...Catch block, the call to CommitTransaction in the Try clause, and the call to RollbackTransaction in the Catch clause.

Example

See Also

MessageQueue Class | MessageQueue Members | System.Messaging Namespace | BeginTransaction | RollbackTransaction | Transactional