Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Who locks what ?
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