SAA-compatible applications

The resource recovery element of the Systems Application Architecture® (SAA) common programming interface (CPI) provides an alternative to the standard CICS application program interface (API) if you need to implement SAA-compatible applications.

The resource recovery facilities provided by the CICS implementation of the SAA resource recovery interface are the same as those provided by CICS API. Therefore, you have to change from CICS API to SAA resource recovery commands only if your application needs to be SAA-compatible.

To use the SAA resource recovery interface, you need to include SAA resource recovery commands in your applications in place of EXEC CICS SYNCPOINT commands. This book refers only to CICS API resource recovery commands; for information about the SAA resource recovery interface, see the CPI Resource Recovery Reference manual.

Program design

This section tells you how to design your programs to use the CICS recovery facilities effectively.

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

You are recommended to plan your application processing units using the following advice:

Procedure

1.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” on page 144).

Short units of work are preferable for several reasons:

vData resources are locked for a shorter time. This reduces the chance of other tasks having to wait for the resource to be freed.

vBackout processing time (in dynamic transaction backout or emergency restart) is shortened.

vThe 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” on page 101), short units of work are essential so that all entered data is committed as soon as possible.

2.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

Chapter 13. Programming for recovery 143

Page 155
Image 155
IBM SC34-7012-01 manual SAA-compatible applications, Program design, Dividing transactions into units of work