Transaction recovery process for IBM MQ .NET

This section describes how distributed transactions can be recovered with IBM® MQ .NET classes.

Overview

To recover an incomplete transaction, the recovery information is required. The transaction recovery information must be logged to storage by the resource managers. IBM MQ .NET classes follow a similar path. The transaction recovery information is logged to a system queue called SYSTEM.DOTNET.XARECOVERY.QUEUE.

Transaction recovery in IBM MQ .NET is a two stage process:
  1. Logging of transaction recovery information in SYSTEM.DOTNET.XARECOVERY.QUEUE.

  2. Recovering transactions by using the XA Monitor application WmqDotnetXAMonitor.

SYSTEM.DOTNET.XARECOVERY.QUEUE

SYSTEM.DOTNET.XARECOVERY.QUEUE is a system queue that holds transaction recovery information for incomplete transactions. This queue is created when a queue manager is created.

For every transaction, during the prepare phase a persistent message containing the recovery information is added to SYSTEM.DOTNET.XARECOVERY.QUEUE. The message is deleted if the commit call succeeds.

Note: You must not delete the SYSTEM.DOTNET.XARECOVERY.QUEUE queue.

WMQDotnetXAMonitor application

IBM MQ .NET XA Monitor application, WmqDotnetXAMonitor, is a .NET managed application that monitors a queue manager, processes messages in SYSTEM.DOTNET.XARECOVERY.QUEUE and recovers incomplete transactions

If the message channel agent (MCA) is unable to put the message to the destination queue, it generates an exception report containing the original message, and puts it on a transmission queue to be sent to the reply-to queue specified in the original message. (If the reply-to queue is on the same queue manager as the MCA, the message is put directly to that queue, not to a transmission queue.)

The following are deemed to be incomplete transactions and are recovered:
  • If the transaction is prepared but COMMIT did not complete within the timeout period.
  • If the transaction is prepared but IBM MQ queue manager has gone down.
  • If the transaction is prepared but then Transaction Manager has gone down.

    The XA Monitor application must be run from the same system where your IBM MQ .NET client application is running. If there are applications that are running on multiple systems and connecting to the same queue manager, WmqDotnetXAMonitor application must be run from all the systems. Though each client machine has an instance of the XA Monitor application running to recover the application, each XA Monitor instance should be able to identify the message that corresponds to transaction that the current XA Monitor's local MS DTC was coordinating so that it can reenlist and complete it.