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.RollbackTransaction

Rolls back the pending internal transaction.

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

Exceptions

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

Remarks

RollbackTransaction marks the unsuccessful completion of a process 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 | CommitTransaction | Transactional