Chapter 11. Transactional support

This chapter gives a brief introduction to transactional support. For a complete description see the WebSphere MQ Application Programming Guide.

An application program can group a set of updates into a unit of work. These updates are usually logically related and must all be successful for data integrity to be preserved. If one update succeeds while another fails, data integrity is lost.

A unit of work commits when it completes successfully. At this point all updates made within that unit of work are made permanent and irreversible. If the unit of work fails, all updates are instead backed out. Syncpoint coordination is the process by which units of work are either committed or backed out with integrity.

A local unit of work is one in which the only resources updated are those of the WebSphere MQ queue manager. Here syncpoint coordination is provided by the queue manager itself using a single-phase commit process.

A global unit of work is one in which resources belonging to other resource managers, such as XA-compliant databases, are also updated. Here, a two-phase commit procedure must be used and the unit of work can be coordinated by the queue manager itself, or externally by another XA-compliant transaction manager such as IBM TXSeries or BEA Tuxedo.

In summary, queue manager resources can be updated as part of local or global units of work:

Local unit of work
Use local units of work when the only resources to be updated are those of the WebSphere MQ queue manager. Updates are committed using the MQCMIT verb or backed out using MQBACK.

Global unit of work
Use global units of work when you also need to include updates to XA-compliant database managers. Here the coordination can be internal or external to the queue manager.

Queue manager coordination
Global units of work are started using the MQBEGIN verb and then committed using MQCMIT or backed out using MQBACK. A two-phase commit process is used whereby XA-compliant resource managers such as DB2(R), Oracle, and Sybase are first asked to prepare to commit. Only if all are prepared successfully are they then asked to commit. If any resource manager signals that it cannot prepare to commit, each is asked to back out instead.

External coordination
Here the coordination is performed by an XA-compliant transaction manager such as IBM CICS, Transarc Encina(R), or BEA Tuxedo. Units of work are started and committed under control of the transaction manager. The MQBEGIN, MQCMIT, and MQBACK verbs are unavailable.

This chapter describes how to enable support for global units of work (support for local units of work does not need to be specifically enabled).

It contains these sections:



© IBM Corporation 1994, 2002. All Rights Reserved