Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> REPOST: Re: Question about locking a record.
"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
![]() |
![]() |