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: SELECT for UPDATE in web application

Re: SELECT for UPDATE in web application

From: Jeff Smith <jsmit234_at_ford.com>
Date: Tue, 25 Feb 2003 10:40:19 -0500
Message-ID: <b3g2p3$kq16@eccws12.dearborn.ford.com>


I locked this row in another session. Looks like ora-00054 is your error to trap for.

ORA-00054: resource busy and acquire with NOWAIT specified

SQL> declare

  2     serr varchar2(512);
  3     cursor c1 is select * from TMPWDVS007_USR_PRF for update of
DVS007_AUTOLOAD_F nowait;
  4 begin
  5
  6 for c1_rec in c1 loop
  7 dbms_output.put_line('got lock');   8 end loop;
  9
 10 exception
 11 when others then
 12 serr := sqlerrm;
 13 dbms_output.put_line(serr);
 14 end;
 15
 16
 17 /
ORA-00054: resource busy and acquire with NOWAIT specified

"Biff Malone" <biffmalone_at_hotmail.com> wrote in message news:f2efd06c.0302250638.13c27e3d_at_posting.google.com...
> If I've got a web application that is doing a SELECT FOR UPDATE for
> one user. When subsequent user comes tries to do a SELECT FOR UPDATE,
> my application just hangs until the lock is released. I've tried using
> the "NOWAIT" clause at the end of the statement, but that doesn't
> help. Is there a test I can do to figure out if there exists a lock
> on a record? Is an exception thrown when a lock exists and the
> application does a SELECT FOR UPDATE (preferably in a non-DB-specific
> way)?
Received on Tue Feb 25 2003 - 09:40:19 CST

Original text of this message

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