Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: how to test locks
What are you trying to accomplish? Since readers don't block writers and
writers don't block readers the only condition I can see where you want to
see if it is locked is when you want to lock it because you are going to
update it. Otherwise, what is the purpose? You could do as they suggest
and if it does NOT error out (meaning you got the lock) then issue commit
and release it. You could even put it in a package as a function and return
1 for locked and 0 for not locked.
Jim
"Mladen Gogala" <mgogala_at_earthlink.net> wrote in message
news:pan.2002.01.23.21.06.44.54202.1011_at_earthlink.net...
> On Wed, 23 Jan 2002 07:41:34 -0500, Ganesh Raja wrote:
>
> > I have a simple question. How can i test weather a record in a table is
> >> > locked by another user without causing another lock.
> -----------------------------
> >> >
>
>
> Look at the "without causing another lock" part of the requirement and
> tell me why do you think that "select for update nowait" satisfies that
> condition?
Received on Wed Jan 23 2002 - 20:52:33 CST