The backout fails because a duplicate key is detected in the AIX indicated by message DFHFC4701, with a failure code of X'F0'. There is no locking on the AIX® key to prevent the second task taking the key before the end of the first task’s unit of work. If there is an application requirement for this sort of operation, you should use the CICS enqueue mechanism to reserve the key until the end of the unit of work.

5.To ensure that the data being read is up-to-date, the application program should:

vFor files accessed in non-RLS mode, issue a READ UPDATE command (rather than a simple READ), thus locking the data until the end of the unit of work

vFor files accessed in RLS mode, use the consistent read integrity option.

Implicit enqueuing on logically recoverable TD destinations

CICS provides an enqueuing protection facility for logically recoverable (as distinct from physically recoverable) transient data destinations in a similar way to that for recoverable files.

There is one minor difference, however: CICS regards each recoverable destination as two separate recoverable resources—one for writing and one for reading.

Transient data control commands that invoke implicit enqueuing are:

vWRITEQ TD

vREADQ TD

vDELETEQ TD

Thus, for example:

vIf a task issues a WRITEQ TD command to a particular destination, the task is enqueued upon that write destination until the end of the task (or unit of work). While the task is thus enqueued:

Another task attempting to write to the same destination is suspended.

Another task attempting to read from the same destination is allowed to read only committed data (not data being written in a currently incomplete unit of work).

vIf a task issues a READQ TD command to a particular destination, the task is enqueued upon that read destination until the end of task (or unit of work). While the task is thus enqueued:

Another task attempting to read from the same destination is suspended.

Another task attempting to write to the same destination is allowed to do so and will itself enqueue on that write destination until end of task (or unit of work).

If a task issues a DELETEQ TD request, the task is enqueued upon both the read and the write destinations. While the task is thus enqueued, no other task can read from, or write to, the queue.

Implicit enqueuing on recoverable temporary storage queues

CICS provides the enqueuing protection facility for recoverable temporary storage queues in a similar way to that for recoverable files on VSAM data sets.

There is one minor difference, however: CICS enqueuing is not invoked for READQ TS commands, thereby making it possible for one task to read a temporary storage queue record while another is updating the same record. To avoid this, use explicit

Chapter 13. Programming for recovery 157

Page 169
Image 169
IBM SC34-7012-01 manual Implicit enqueuing on logically recoverable TD destinations, Writeq TD Readq TD Deleteq TD