WebSphere Message Brokers
File: ac00645_
Writer: Karen Cameron

Concept topic

This build: July 31, 2007 21:16:57

Message flow transactions

A message flow can be one of two styles:
Coordinated message flows
These ensure that all updates to resources are committed or rolled back together within a single transaction.
Uncoordinated message flows
These allow updates to resources to occur independently; the updates are not affected by the overall success or failure of the message flow.

Coordinated message flows

You can configure a message flow that includes interaction with an external database or other recoverable resource so that all of its processing is coordinated within a single, global, transaction. This coordination ensures that either all processing is successfully completed, or no processing is completed. The transaction is committed (if all processing is successful), or rolled back (if at least one part of the processing is unsuccessful). Therefore, all affected resources (queues, databases, and so on) are maintained in a consistent state, and data integrity is preserved.

Updates that are made by a coordinated message flow are committed when the flow processes the input message successfully. The updates are backed out if both of the following conditions are met:
  • Any node within the flow throws an exception that is not caught by a node other than the input node
  • The input node’s Catch terminal is not connected

To configure a message flow as coordinated, set the Coordinated property on the message flow.

For some input nodes, such as MQInput or SCADAInput nodes, set the Transaction Mode property on the nodes in the flow to Automatic. The Automatic option makes messages part of the global transaction, and marks the message flow as transactional if the input message is persistent, or uncoordinated if the input message is not persistent. Subsequent nodes in the flow that set the Transaction Mode property to Automatic are included in the global transaction if the flow is marked transactional by the input node.

Transaction coordination of message flows is provided on distributed systems by WebSphere MQ, and on z/OS systems by RRS. Message flows are always globally coordinated on z/OS, regardless of the setting of the message flow’s Coordinated property.

Uncoordinated message flows

Uncoordinated flows are flows for which the Coordinated property is not set. Updates to resources that are used by a uncoordinated flow are managed by the separate resource managers. Some resource managers, such as WebSphere MQ, allow updates to be made non-transactionally, or as part of a resource-specific transaction. Other resource managers, such as database managers, always use a resource-specific transaction. A resource-specific transaction is a transaction with a scope that is limited to the resources that are owned by a single resource manager, such as a database or queue manager.

Resource-specific transactions are typically used when only one type of recoverable resource is used in a flow. An example of such a flow is one that contains an MQInput and an MQOutput node, but which does not access any databases. Do not use resource-specific transactions when more than one resource exists and data integrity must be maintained.

Updates that are made to a resource that is accessed non-transactionally are committed immediately. An MQInput node that is configured to be non-transactional removes messages from the queue immediately; if the flow fails, the messages are lost.

Set the Transaction Mode property to Automatic to make some input nodes (such as MQInput or SCADAInput) part of a transaction, depending on the persistence of the input message. If the input message is persistent, messages are made part of the transaction, and the flow is marked as transactional. If the message is not persistent, the flow is marked as non-transactional.

The following sample demonstrates the use of globally-coordinated transactions and the differences in the message flow when database updates are coordinated (the main flow), and when they are not (the error flow). You can view samples only when you use the information center that is integrated with the Message Brokers Toolkit.
Related concepts
Message flows overview
Related tasks
Creating a message flow
Defining message flow content
Configuring globally coordinated message flows
Handling errors in message flows
Related reference
Built-in nodes
Database connections for coordinated message flows
Database support for coordinated message flows
Notices | Trademarks | Downloads | Library | Support | Feedback

Copyright IBM Corporation 1999, 2007Copyright IBM Corporation 1999, 2007. All Rights Reserved.
This build: July 31, 2007 21:16:57

ac00645_ This topic's URL is: