Rolls back the pending internal transaction.
[Visual Basic] Public Sub RollbackTransaction() [C#] public void RollbackTransaction(); [C++] public: void RollbackTransaction(); [JScript] public function RollbackTransaction();
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. |
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.
MessageQueue Class | MessageQueue Members | System.Messaging Namespace | BeginTransaction | CommitTransaction | Transactional