Deadlock detection scenarios

The following deadlock scenarios demonstrate deadlock detection and use of the IBM OMEGAMON® for Db2 Performance Expert on z/OS® deadlock detail report to determine the cause of a deadlock.

Begin program-specific programming interface information.Deadlocks can often be avoided if concurrent applications access data in the same sequence. In some cases row-level locking can reduce the number of deadlocks and timeouts.

The IBM OMEGAMON for Db2 Performance Expert on z/OS Locking Trace - Deadlock report formats the information contained in trace record IFCID 0172 (statistics class 3). The report outlines all the resources and agents involved in a deadlock and the significant locking parameters, such as lock state and duration, related to their requests.

These examples assume that statistics class 3 and performance class 1 are activated. Performance class 1 is activated to get IFCID 105 records, which contain the translated names for the database ID and the page set OBID.

The scenarios that follow use three of the Db2 sample tables, DEPT, PROJ, and ACT. They are all defined with LOCKSIZE ANY. Indexes are used to access all three tables. As a result, contention for locks is only on data pages. End program-specific programming interface information.