Topic
2 replies Latest Post - ‏2008-02-15T02:43:41Z by SystemAdmin
SystemAdmin
SystemAdmin
1525 Posts
ACCEPTED ANSWER

Pinned topic How to read the deadlock log

‏2008-02-12T07:20:16Z |
Hi,

My question is about the reading of deadlock. I am not sure what the (1,14) stands for in "Lock : ROW, DEPARTMENT, (1,14)" one the third line. Could anyone give some hint? Thanks!

ERROR 40001: A lock could not be obtained due to a deadlock,
cycle of locks & waiters is:
Lock : ROW, DEPARTMENT, (1,14)
Waiting XID : {752, X} , APP, update department set location='Boise'
_ where deptno='E21'_
Granted XID : {758, X} Lock : ROW, EMPLOYEE, (2,8)
Waiting XID : {758, U} , APP, update employee set bonus=150 where salary=23840
Granted XID : {752, X} The selected victim is XID : 752
Updated on 2008-02-15T02:43:41Z at 2008-02-15T02:43:41Z by SystemAdmin
  • Stan
    Stan
    267 Posts
    ACCEPTED ANSWER

    Re: How to read the deadlock log

    ‏2008-02-15T01:32:12Z  in response to SystemAdmin
    Hi Eating -
    You will get more information about the deadlocks by setting lockMonitor and deadlockTrace. See the "How do I set up my development environment for Derby?" section of the Cloudscape FAQ at:
    http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408bradbury/#cs_setEnv
    for information on setting these and other helpful debug/test properties.

    The information you provide shows the statement:
    update department set location='Boise' where deptno='E21'
    was rolled back while waiting to obtain a lock which was being held by the statement: update employee set bonus=150 where salary=23840.

    I'm guessing a trigger is involved since the statements are updating different tables. The number you ask about indicates the page and row in the page of the record. Dept table - Page:1 Row:14.
  • SystemAdmin
    SystemAdmin
    1525 Posts
    ACCEPTED ANSWER

    Re: How to read the deadlock log

    ‏2008-02-15T02:43:41Z  in response to SystemAdmin
    Thanks, Great!
    I previously guess it was a range lock.
    Updated on 2008-02-15T02:43:41Z at 2008-02-15T02:43:41Z by SystemAdmin