IBM SC34-7012-01 manual Possibility of transaction deadlock

Models: SC34-7012-01

1 268
Download 268 pages 41.5 Kb
Page 171
Image 171
Possibility of transaction deadlock

After a task has issued an ENQ RESOURCE(data-area) command, any other task that issues an ENQ RESOURCE command with the same data-area parameter is suspended until the task issues a matching DEQ RESOURCE(data-area) command, or until the unit of work ends.

Note: Enqueueing on more than one resource concurrently might create a deadlock between transactions.

Possibility of transaction deadlock

The enqueuing and program isolation scheduling mechanisms, which protect resources against double updating, can cause a situation known as transaction

deadlock.

As shown in Figure 15, transaction deadlock means that two (or more) tasks cannot proceed because each task is waiting for the release of a resource that is enqueued upon by the other. (The enqueuing, DL/I program isolation scheduling action, or VSAM RLS locking action protects resources until the next synchronization point is reached.)

TASK A

.

.

Update resource 1

.

.

.

Update resource 2

.(Wait)

.

.

.

Syncpoint

TASK B

.

.

.

 

 

 

Update resource 2

 

 

 

 

 

.

 

 

.

 

 

.

 

 

 

 

 

Update resource 1

 

 

 

 

(Wait)

.

 

 

.

 

 

.

 

 

Syncpoint

Figure 15. Transaction deadlock (generalized)

If transaction deadlock occurs, one task abends and the other proceeds.

vIf both deadlocked resources are non-RLS resources, CICS file control detects the deadlock and abends one of the transactions with an AFCF abend code.

vIf both deadlocked resources are VSAM RLS resources, deadlock detection is performed by VSAM. If VSAM detects an RLS deadlock condition, it returns a deadlock exception condition to CICS, causing CICS file control to abend the transaction with an AFCW abend code. CICS also writes messages and trace entries that identify the members of the deadlock chain.

Note: VSAM cannot detect a cross-resource deadlock (for example, a deadlock arising from use of RLS and DB2 resources) where another resource manager is involved. VSAM resolves a cross-resource deadlock when the timeout period expires, as defined by either the DTIMOUT or FTIMEOUT parameters, and the waiting request is timed out. In this situation, VSAM cannot determine whether the timeout is caused by a cross-resource deadlock, or by a timeout caused by another transaction acquiring an RLS lock and not releasing it.

vIf the resources are both DL/I databases, DL/I itself detects the potential deadlock as a result of the tasks issuing their scheduling calls. In this case, DL/I causes CICS to abend the task that has the least update activity (with abend code ADCD).

Chapter 13. Programming for recovery 159

Page 171
Image 171
IBM SC34-7012-01 manual Possibility of transaction deadlock