Results 1 to 4 of 4
  1. #1
    Join Date
    Jun 2002
    Posts
    3

    Unanswered: how to get deadlock infomation about database in java coding??

    how to get deadlock infomation about database in java coding??
    i want to get the application id, table, record and so on in deadlock.

  2. #2
    Join Date
    Oct 2001
    Posts
    68
    The easiest way is to build your own SQLException handler and use pre-populated information from the SQL text itself. We use a helper class that all SQL statements are processed in. This stores the table/view names, keys in use, connection data, timestamp etc.

    When a -911,-912 or -913 occurs we raise an internal exception which is cascaded back to the high-level catch and boom.. we know what happened, when and to what.

    The one thing this doesn't give us though is who the "Holder" was in the "Holder/Victim" scenario. I'm working on that one right now.

    WP
    William P.O'Sullivan

    IBM Certified Solutions Expert - DB2 UDB V7.1 Database Administration for Unix, Linux, Windows and OS/2
    OS/390, AIX, Linux and Windows2000

  3. #3
    Join Date
    Jun 2002
    Posts
    3

    sorry,i foget something.

    i want to get all deadlocks in a database.
    and list all the infomation.

    i can do this in oracle in (execute " select * from v$session where lockwait is not null")

    i want to get infomation from the system tables.

    thanks a lot.

  4. #4
    Join Date
    Aug 2001
    Location
    UK
    Posts
    4,650

    Re: sorry,i foget something.

    DB2 doesn't store deadlock information in system tables ....

    Cheers

    Sathyaram

    Originally posted by chenjie
    i want to get all deadlocks in a database.
    and list all the infomation.

    i can do this in oracle in (execute " select * from v$session where lockwait is not null")

    i want to get infomation from the system tables.

    thanks a lot.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •