IBM MQ for z/OS must interact with other subsystems to keep all
the data consistent. This topic contains information about units of recovery, what they are
and how they are used in back outs.
Units of recovery
A unit of recovery is the processing done by a single queue manager for an application
program, that changes IBM MQ data from one point of
consistency to another. A point of consistency - also called a syncpoint or commit
point - is a point in time when all the recoverable data that an application program accesses is
consistent.
Figure 1. A unit of recovery within an application program. Typically, the unit of recovery consists of more than one MQI call. More than one unit of
recovery can occur within an application program.
A unit of recovery begins with the first change to the data after the beginning of the program or
following the previous point of consistency; it ends with a later point of consistency. Figure 1 shows the relationship between units of
recovery, the point of consistency, and an application program. In this example, the application
program makes changes to queues through MQI calls 1 and 2. The application program can include more
than one unit of recovery or just one. However, any complete unit of recovery ends in a commit
point.
For example, a bank transaction transfers funds from one account to another. First, the program
subtracts the amount from the first account, account A. Then, it adds the amount to the second
account, B. After subtracting the amount from A, the two accounts are inconsistent and IBM MQ cannot commit. They become consistent when the amount is
added to account B. When both steps are complete, the program can announce a point of consistency
through a commit, making the changes visible to other application programs.
Normal termination of an application program automatically causes a point of consistency. Some
program requests in CICS and IMS programs also cause a point of consistency, for example,
EXEC CICS SYNCPOINT.
Backing out work
If an error occurs within a unit of recovery, IBM MQ removes any changes to data, returning the data to its state at the start of the unit of recovery;
that is, IBM MQ backs out the work. The events are shown
in Figure 2.
Figure 2. A unit of recovery showing back outParent topic:Recovery and restart on z/OS