Re: deadlock detection

  • From: "Jonathan Lewis" <jonathan@xxxxxxxxxxxxxxxxxx>
  • To: <oracle-l@xxxxxxxxxxxxx>
  • Date: Fri, 2 Apr 2004 07:14:54 +0100

When transaction B attempts to lock the row,
it sees the lock byte on the row is set, and checks
the ITL in the block to discover all it can about
the transaction in that ITL position.  (e.g. has it
committed, leaving the block to be cleaned; is
it still active).

If the holding transaction is still active, transaction
B queues on the transaction table slot (the entry
in the segment header block) waiting for it to go
from active to free.  It doesn't check the row again,
it waits for a commit, or a full rollback. (In general
a rollback to savepoint won't help, but there are a
couple of special cases).

Regards

Jonathan Lewis
http://www.jlcomp.demon.co.uk

The Co-operative Oracle Users' FAQ
http://www.jlcomp.demon.co.uk/faq/ind_faq.html

April 2004 Iceland  http://www.index.is/oracleday.php
June  2004      UK - Optimising Oracle Seminar


----- Original Message ----- 
From: "Ryan" <ryan.gaffuri@xxxxxxx>
To: <oracle-l@xxxxxxxxxxxxx>
Sent: Friday, April 02, 2004 4:45 AM
Subject: deadlock detection


How does oracle detect deadlocks? Here is my best guess. Oracle's lock
manager tracks locks at the object level, but not at the row level.
transaction A locks row  1 in table A
transaction B locks row 1 in table B

Transaction A attempts to lock row 1 in table B, but is forced to wait.
Transaction B attempts to lock row 1 in table A, but is forced to wait.


The oracle lock manager notes that this at the object level. So it is
possible that this is a deadlock. The lock manager then checks the
transaction table for the row that is locked in each table and from that can
determine whether this is a deadlock condition.

Am I correct?
----------------------------------------------------------------
Please see the official ORACLE-L FAQ: http://www.orafaq.com
----------------------------------------------------------------
To unsubscribe send email to:  oracle-l-request@xxxxxxxxxxxxx
put 'unsubscribe' in the subject line.
--
Archives are at //www.freelists.org/archives/oracle-l/
FAQ is at //www.freelists.org/help/fom-serve/cache/1.html
-----------------------------------------------------------------


----------------------------------------------------------------
Please see the official ORACLE-L FAQ: http://www.orafaq.com
----------------------------------------------------------------
To unsubscribe send email to:  oracle-l-request@xxxxxxxxxxxxx
put 'unsubscribe' in the subject line.
--
Archives are at //www.freelists.org/archives/oracle-l/
FAQ is at //www.freelists.org/help/fom-serve/cache/1.html
-----------------------------------------------------------------

Other related posts: