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 -> REPOST: Re: Question about locking a record.

REPOST: Re: Question about locking a record.

From: andrija <ar35644_at_fer.hr>
Date: Mon, 31 Dec 2001 09:00:02 +0100
Message-ID: <3$--$$-$$_%_-$_$%$@news.noc.cabal.int>

"C Chang" <cschang_at_maxinter.net> wrote in message news:3C2EB5CC.6CDD_at_maxinter.net...
> I have an update procedure needed to lock the reocrd for a certain of
> period. Can Oracle DBMS or in PL/SQL do this? The problem comes from a
> web page that transfers its content to a new page waiting for further
> process. When the record is transfered, I would like it been locked for
> a certain of time, so that the same record can not be updated during the
> transfered and processed. Since I do not know how long the record will
> be finished the process ( it may not as user walks away ), so I need the
> reocrd only be locked for a ceratin of time. Thanks in advance.
>
> C Chang

You could alter your table so it has two more fileds: row_locked -char(1) with value '0' or '1' and field lock_time - date. So in your procedure if row_locked='0' you set it to '1', and trigger could set the lock_time. If row_locked='1' and lock_time>sysdate-0.0000xxx then you wait, and if lock time expired you lock it again and continue.

This message was cancelled from within Mozilla...not Received on Mon Dec 31 2001 - 02:00:02 CST

Original text of this message

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