Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: What Happens When You Try To Lock A Table That's Already Locked?

Re: What Happens When You Try To Lock A Table That's Already Locked?

From: Jeremiah Wilton <jeremiah_at_amazon.com>
Date: Thu, 21 Oct 1999 13:36:29 -0700
Message-ID: <380F794D.BD47E38D@amazon.com>


john_galt29_at_my-deja.com wrote:
>
> ... I suppose the obvious answer here is DEADLOCK.

That is not a deadlock. Recently in the oracle newsgroups, people seem to have become fond of referring to blocking lock situations as deadlocks. This is not correct use of terminology.

A deadlock is a "deadly embrace" that only happens when two sessions encounter a locking race condition in which each session waits trying to acquire the lock held by the other session. Oracle detects these conditions automatically, and one of the sessions loses out and generates a trace file. Deadlocks are fleeting and do not involve extended blocking situations.

> How can I get Oracle to throw an exception if it tries to lock a table
> that is already locked?

select ... for update nowait;

--
Jeremiah Received on Thu Oct 21 1999 - 15:36:29 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US