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

Home -> Community -> Usenet -> c.d.o.server -> Re: Who locks what ?

Re: Who locks what ?

From: <markp7832_at_my-deja.com>
Date: Mon, 21 Feb 2000 16:42:44 GMT
Message-ID: <88rpu2$9so$1@nnrp1.deja.com>


In article <6h8s4.7$mN.511_at_nreader3.kpnqwest.net>,   "Didier LENQUETTE" <didier.lenquette_at_steria.fr> wrote:
> Hi !
>
> I manage locks into my database with SELECT ... FOR UPDATE NOWAIT.
>
> When a record is already locked by another user, I wish to know who is
> locking the record I am trying to lock, in order to display a message
to the
> user, such as "User toto is locking this record".
>
> I know the locked objects with the v$lock view and the "locker", but
I don't
> know who locks a particular record !
>
> An idea ?
>
> ________________
> Didier LENQUETTE
> Tel : (33) 5 62 12 20 40
> Fax : (33) 5 61 31 07 02
>

The only way I know to find who has a specific row locked is to attempt to update the row (or select for update) without the nowait option so that you become lockwaited then you can use another session to determine the holding session.

You could devise a user locking scheme using dbms_lock that could provide this, but I would think that the overhead would be very expensive.
--
Mark D. Powell -- The only advice that counts is the advice that  you follow so follow your own advice --

Sent via Deja.com http://www.deja.com/
Before you buy. Received on Mon Feb 21 2000 - 10:42:44 CST

Original text of this message

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