Chapter 13. Programming for recovery

When you are designing your application programs, you can include recovery facilities that are provided by CICS; for example, you can use global user exits for backout recovery.

This section covers the following topics:

v“Designing applications for recovery”

v“Program design” on page 143

v“Managing transaction and system failures” on page 149

v“Locking (enqueuing on) resources in application programs” on page 153

v“User exits for transaction backout” on page 160

Designing applications for recovery

In this context, application refers to a set of one or more transactions designed to fulfill the particular needs of the user organization. A transaction refers to a set of actions within an application which the designer chooses to regard as an entity. It corresponds to a unit of execution, which is typically started in a CICS region by invoking the transaction by its identifier from a terminal attached to CICS.

As an application designer, you must decide how (if at all) to subdivide an application into transactions, and whether the transactions should consist of just one unit of work, or more than one.

Ideally, but not necessarily, a transaction would correspond to a unit of work. Dividing the business application into units of work that correspond to transactions simplifies the entire recovery process.

An example of a typical business application is an order-entry system. A typical order-entry application includes all the processes needed to handle one order from a customer, designed as a set of processing units, as follows:

1.Check the customer’s name and address and allocate an order number.

2.Record the details of ordered items and update inventory files.

3.Print the invoice and shipping documents.

Depending on the agreed recovery requirements statement, you could design noting details of ordered items and updating files either as one large transaction or as several transactions, with one transaction for each item within the order.

Splitting the application into transactions

Specify how to divide the application into transactions.

About this task

Procedure

1.Name each transaction, and describe its function in terms that the terminal user can understand. Your application could include transactions to recover from failures, such as:

© Copyright IBM Corp. 1982, 2010

141

Page 153
Image 153
IBM SC34-7012-01 manual Programming for recovery, Designing applications for recovery