Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Does Oracle have a timeout feature
There isn't a lock timeout but you can do...
got_it := false;
for i in 1 .. 10 loop
begin select blah blah for update nowait; got_it := true; exit; exception when lock_timeout then dbms_lock.sleep(1); end;
if got_it then
etc etc
Cheers
Connor
George Gastelum wrote:
> Hi,
>
> I was checking if Oracle 7.3.2 has a timeout feature. For example, I
> lock a
> record by doing an update on it. Someone comes after me and tries to do
> an update
> to that same record. If I do not do a commit for a few hours the other
> persons
> command will wait until after I do a commit. I would like to know if
> there is a
> command that will wait for a specified amount of time. If there is no
> response
> after that time, it will give control back to the process that is trying
> to
> access Oracle. In ingres the command is:
>
> set lockmode on <table> where level = <level>, timeout = <timeout>
>
> That command returns control to the process that is trying to access
> ingres
> after the timeout value has been reached. I checked alter session but
> did not
> see anything that would help me.
>
> Thanks,
> George
-- ========================================== Connor McDonald BHP Information Technology Perth, Western Australia "These views mine not BHP..etc etc" "The only difference between me and a madman is that I am not mad."Received on Mon Nov 24 1997 - 00:00:00 CST
![]() |
![]() |