Dividing transactions into units of work
You must decide how to implement application processing units in terms of transactions, units of work, and programs.
About this task
Procedure
- In programs that support a dialog with the user, consider
implementing each unit of work to include only a single terminal
read
and a single terminal write.
Using this approach can simplify
the user restart procedures (see also
Processing dialogs with users).
Short units of work are preferable for several reasons:
- Data resources are locked for a shorter time. This reduces the chance of other tasks having to wait for the resource to be freed.
- Backout processing time (in dynamic transaction backout or emergency restart) is shortened.
- The user has less to re-enter when a transaction restarts after
a failure.
In applications for which little or no re-keying is feasible (discussed in question 9 under Questions relating to recovery requirements ), short units of work are essential so that all entered data is committed as soon as possible.
- Consider the recovery/restart implications when deciding
whether to divide a transaction into many units of work.
CICS® functions such as dynamic transaction backout and transaction restart work most efficiently for transactions that have only one unit of work. But there can be situations in which multiple-unit of work transactions are necessary, for example if a set of file or database updates must be irrevocably committed in one unit of work, but the transaction is to continue with one or more units of work for further processing.
- Where file or database updates must be kept in step, make sure that your application does them in the same unit of work. This approach ensures that those updates will all be committed together or, in the event of the unit of work being interrupted, the updates will back out together to a consistent state.
dfht231.html |
Last updated: Monday, 5 June 2017