Configuring nodes for coordinated message flows

If you want to coordinate the message flow processing with other resources, you must configure properties both of the nodes within the message flow and of the message flow itself.

Before you start:

A coordinated message flow executes within a single transaction, which is started when a message is received by an input node, and can be committed or rolled back when all processing has completed. You can also control how database errors are handled by the node that interacts with the database.

To configure the message flow and the nodes:

  1. Switch to the Broker Application Development perspective.
  2. Open the message flow that you want to work with, or create a new message flow.
  3. Set the Transaction property for the following nodes if they appear in this message flow:
    • Compute
    • Database
    • DataDelete
    • DataInsert
    • DataUpdate
    • Filter
    • Mapping
    • Warehouse

    You can set the Transaction property to the following values:

    Automatic
    Any updates, deletions, and additions performed by the node are committed or rolled back when the message flow processing completes. If the message flow completes successfully, all changes are committed. If the message flow does not complete successfully, all changes are rolled back.

    If you want all processing by the message flow to be coordinated, you must select this value.

    Commit
    The action taken depends on the system to which the message flow has been deployed:
    • On distributed systems, any work that has been done to this data source in this message flow to date, including any actions taken in this node, is committed regardless of the subsequent success or failure of the message flow.
      Note: On platforms other than z/OS, individual relational databases may or may not support this mode of operation.
    • On z/OS, actions taken in this node only are committed regardless of the subsequent success or failure of the message flow. Any actions taken before this node under automatic transactionality are not committed, but remain within a unit of work and might either be committed or rolled back depending on the success of the message flow.
    If you want to mix nodes with Automatic and Commit transactionality in the same message flow, where the nodes operate on the same external database, you must use separate ODBC connections: one for the nodes that are not to commit until the completion of the message flow, and one for the nodes that are to commit immediately. If you do not, the nodes that commit immediately will also commit all operations carried out by preceding Automatic nodes.
    Note: On platforms other than z/OS, individual relational databases may or may not support this mode of operation.

    If you define more than one ODBC connection you might get database locking problems. In particular, if a node with Automatic transactionality carries out an operation, such as an INSERT or an UPDATE, that causes a database object (such as a table) to be locked, and a subsequent node tries to access that database object using a different ODBC connection, an infinite lock (deadlock) occurs.

    The second node waits for the lock acquired by the first to be released, but the first node will not commit its operations and release its lock until the message flow completes; this will never happen because the second node is waiting for the first node's database lock to be released.

    Such a situation cannot be detected by any DBMS automatic deadlock-avoidance routines because the two operations are interfering with each other indirectly, using the broker.

    There are two ways to avoid this sort of locking problem:

    • Design your message flow so that uncommitted (automatic) operations do not lock database objects that subsequent operations using a different ODBC connection need to access.
    • Configure your database's lock timeout parameter so that an attempt to acquire a lock fails after a specified length of time. If a database operation fails due to a lock timeout, an exception is thrown that the broker handles in the normal way.

    For information concerning which database objects are locked by particular operations, and how to configure your database's lock timeout parameter, consult your database product documentation.

  4. Set the Transaction Mode property for the following nodes, if they appear in this message flow:
    • MQInput
    • MQOutput
    • MQReply
    • SCADAInput
    • JMSInput node
    • JMSOutput node

    The table below provides a summary of the actions taken in response to specific property settings for the input and output nodes.

    Message persistence a Input node Transaction Mode MQOutput or MQReply node Transaction Mode Message flow is globally coordinated?
    Yes Yes Automatic Yes
    No Yes Automatic Yes
    Yes No Automatic No
    No No Automatic No
    Yes Automatic Automatic Yes
    No Automatic Automatic No
    Any b Any b Yes Yes
    Any b Any b No No
    Notes:
    1. Persistence is relevant only for messages received across the WebSphere MQ Enterprise Transport, WebSphere MQ Mobile Transport, and WebSphere MQ Telemetry Transport protocols.
    2. The MQOutput or MQReply node property setting overrides the value set here.
    3. The Transaction Mode settings of the JMSInput and JMSOutput nodes are set differently to the above table. See JMSInput node and JMSOutput node for information.

    The default on each input node is Yes, which means that the incoming messages are processed under syncpoint. In addition, messages sent to the output node are delivered under syncpoint. You can change this behavior if the output node is an MQOutput or MQReply node, both of which have a Transaction Mode property.

    If you set the Transaction Mode on an input node to Automatic, the incoming messages are processed under syncpoint only if they are defined as persistent. Messages sent to the MQOutput node are delivered under syncpoint unless you explicitly change the Transaction Mode in the MQOutput node.

  5. Set the Treat warnings as errors and Throw exception on database error for each node that accesses a database to indicate how you want that node to handle database warnings and errors. Whether you select these properties, and how you connect the failure terminals of the nodes, also affect the way in which database updates are committed or rolled back.
  6. Switch to the Broker Administration perspective.
  7. Add the message flow to a broker archive.
  8. Select the Configure tab below the broker archive editor view and select the message flow. This displays the configurable properties for the message flow within the broker archive. Select the check box coordinatedTransaction to configure the message flow as globally coordinated.

    On z/OS, transactions are always globally coordinated. The setting of the coordinatedTransaction property for a message flow is ignored. Coordination is always provided by RRS.

Related concepts
Message flows overview
Message flow transactions
Related tasks
Accessing databases from message flows
Configuring coordinated message flows
Handling errors in message flows
Editing configurable properties
Related reference
Supported databases
Built-in nodes