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: Does Oracle have a timeout feature

Re: Does Oracle have a timeout feature

From: Connor McDonald <mcdonald.connor.cs_at_bhp.com.au>
Date: 1997/11/24
Message-ID: <34794D4F.D02A9DF@bhp.com.au>#1/1

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;

  end loop;

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

Original text of this message

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