Results 1 to 4 of 4
  1. #1
    Join Date
    Apr 2008
    Posts
    39

    Unanswered: Loack wait and deadlock

    Hi
    I am trying to understand deadlock and lock wait situation.lets take a example where two or more process ids are in lock-wait mode. What happens to them according to execution point of view. will application be continue to execute and will keep trying to acquire the locks and execution speed may be slow a bit.

    Please comment on it.

    Thanks in advance
    Naval K

  2. #2
    Join Date
    Jan 2003
    Posts
    4,292
    Provided Answers: 5
    Deadlock is process A locks resource X. Process B locks resource Y. Process A wants Resource Y, but waits for lock from B. Process B wants resource X. This is a deadlock. DB2 will pick one of A or B and rollback the transaction, so the other one can continue.

    Lock Wait is process A locks resource X. Process B wants resource X. It will wait until one of the following conditions are met. Process A releases the lock. Process B waits too long and times out based on parameter (this can be set to never timeout). Db2 kills transaction for reason of a deadlock.

    Andy

  3. #3
    Join Date
    Oct 2009
    Location
    221B Baker St.
    Posts
    486
    Just fyi - a deadlock is often called a "fatal embrace" or a "deadly embrace".

    DB2 will pick one of A or B and rollback the transaction, so the other one can continue.
    Unless there is somethng new in db2, the "4th request" will be the one terminated with the deadlock condition. Then the other process will continue.

  4. #4
    Join Date
    Aug 2008
    Posts
    147
    Troubleshoot the deadlock with a Deadlock Event Monitor. This allows you to capture the deadlock details.
    ---------------------------------
    www.sqlserver-dba.com
    www.dba-db2.com

Posting Permissions

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