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: Lock timeout on oracle 8i

Re: Lock timeout on oracle 8i

From: Yong Huang <yong321_at_yahoo.com>
Date: 24 May 2002 21:03:42 -0700
Message-ID: <b3cb12d6.0205242003.13cc4bc8@posting.google.com>


Regardless what others day, I think you have a legitimate requirement and the code looks OK (I didn't try). What's your question then? Did you try? Does it work?

Yong Huang

rsusanto_at_atlas-sp.com (Rudy Susanto) wrote in message news:<1a928d0b.0205232010.45b85f49_at_posting.google.com>...
> declare
> i number(3,0);
> v_ename varchar2(10);
>
> busy exception;
> pragma exception_init(busy,-54);
>
> begin
> i := 1;
> loop
> begin
> select ename into v_ename
> from emp
> where empno=7900 for update nowait;
> dbms_output.put_line('ename: ' || v_ename);
>
> exception
> when busy then
> if i < 3 then
> dbms_lock.sleep(0.5);
> else
> dbms_output.put_line('Locking record(s) failed ...');
> exit;
> end if;
> end;
>
> i := i + 1;
> end loop;
> end;
Received on Fri May 24 2002 - 23:03:42 CDT

Original text of this message

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