Syncpoint considerations in WebSphere MQ applications

 

Two-phase commit is supported under:

Single-phase commit is supported under:

For further details on external interfaces see Interfaces to external syncpoint managers, and the XA documentation CAE Specification Distributed Transaction Processing: The XA Specification, published by The Open Group. Transaction managers (such as CICS, IMS™, Encina, and Tuxedo) can participate in two-phase commit, coordinated with other recoverable resources. This means that the queuing functions provided by WebSphere MQ can be brought within the scope of a unit of work, managed by the transaction manager.

Samples shipped with WebSphere MQ show WebSphere MQ coordinating XA-compliant databases. For further information about these samples, see Sample programs (all platforms except z/OS).

In your WebSphere MQ application, you can specify on every put and get call whether you want the call to be under syncpoint control. To make a put operation operate under syncpoint control, use the MQPMO_SYNCPOINT value in the Options field of the MQPMO structure when you call MQPUT. For a get operation, use the MQGMO_SYNCPOINT value in the Options field of the MQGMO structure. If you do not explicitly choose an option, the default action depends on the platform. The syncpoint control default on z/OS is yes; for all other platforms, it is no.

When your application receives an MQRC_BACKED_OUT reason code in response to an MQPUT or MQGET under syncpoint, the application should normally back out the current transaction using MBACK and then, if appropriate, retry the entire transaction. If the application receives MQRC_BACKED_OUT in response to an MQCMIT or MQDISC call, it does not need to call MQBACK.

Every time an MQGET call is backed out, the BackoutCount field of the MQMD structure of the affected message is incremented. A high BackoutCount indicates a message that has been repeatedly backed out. This might indicate a problem with this message, which you should investigate. See BackoutCount for details of BackoutCount.

Except on z/OS batch with RRS, if a program issues the MQDISC call while there are uncommitted requests, an implicit syncpoint occurs. If the program ends abnormally, an implicit backout occurs. On z/OS, an implicit syncpoint occurs if the program ends normally without first calling MQDISC.

For WebSphere MQ for z/OS programs, we can use the MQGMO_MARK_SKIP_BACKOUT option to specify that a message should not be backed out if backout occurs (in order to avoid an MQGET-error-backout loop). For information about using this option, see Skipping backout.

Changes to queue attributes (either by the MQSET call or by commands) are not affected by the committing or backing out of units of work.

 

Parent topic:

Committing and backing out units of work


fg13630_