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: Executing a Lock Timeout

Re: Executing a Lock Timeout

From: Connor McDonald <connor_mcdonald_at_yahoo.com>
Date: 2000/04/11
Message-ID: <38F32821.5DA6@yahoo.com>#1/1

lenaf7_at_yahoo.com wrote:
>
> Hi,
>
> How do I place or execute a Lock Timeout within the database of 30
> minutes? Is this possible? Any information that you can provide will
> be helpful.
>
> Thanks, Selena
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.

Some options -

  1. dbms_lock package allows lock timeouts - but you have to have your application built around this.
  2. When trying to lock records, have some code like:

loop
  begin
    (try and lock rows with NOWAIT clause)      exit;
  exception when others then

     if sqlcode = -54 (I think) then
        if no_of_attempts > 30 then
           raise;
        else
           no_of_attempts := no_of_attempts + 1
          dbms_lock.sleep(60);
        end if;
     end if;

  end;
end;
(lock has been obtained - proceed as per normal)

3) Create a loopback database link and take advantage of distributed_lock_timeout.

HTH

-- 
===========================================
Connor McDonald
http://www.oracledba.co.uk

We are born naked, wet and hungry...then things get worse
Received on Tue Apr 11 2000 - 00:00:00 CDT

Original text of this message

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