Units of work

The consistency property of a transaction ensures that data is in a consistent state when a transaction starts and when it ends. The recoverable sequence of operations performed by a transaction between two points of consistency is known in CICS as a unit of work.

Commonly, a transaction consists of just one unit of work, but CICS allows a transaction to consist of a sequence of one or more units of work. The end of each unit of work is marked by a synchronization point, normally abbreviated to sync point. CICS always provides a sync point at the end of a transaction. In addition, at those points where the data is known to be in a consistent state and changes can be committed, an application program can provide intermediate sync points that divide a transaction into two or more units of work.

When a transaction consisting of several units of work ends abnormally, CICS rolls back the changes to data to restore it to its state following the last successful sync point in the transaction. If the failure occurs in the first unit of work, that is, before the first sync point, CICS restores the data to its state at the start of the transaction.

A unit of work that has made changes to data that have not yet been committed (or rolled back) is said to be in-flight.