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 -> Re: Does Oracle have a timeout feature

Re: Does Oracle have a timeout feature

From: Peter Schneider <pschneider.ctj_at_metronet.de>
Date: 1997/11/23
Message-ID: <34780b41.1402805@pop-news.metronet.de>#1/1

On Thu, 20 Nov 1997 15:04:47 -0600, George Gastelum <ggastelu_at_bnr.ca> wrote:

>Hi,
>
>I was checking if Oracle 7.3.2 has a timeout feature. For example, I
>lock a
>record by doing an update on it. Someone comes after me and tries to do
>an update
>to that same record. If I do not do a commit for a few hours the other
>persons
>command will wait until after I do a commit. I would like to know if
>there is a
>command that will wait for a specified amount of time. If there is no
>response
>after that time, it will give control back to the process that is trying
>to
>access Oracle. In ingres the command is:
>
>set lockmode on <table> where level = <level>, timeout = <timeout>
>
>That command returns control to the process that is trying to access
>ingres
>after the timeout value has been reached. I checked alter session but
>did not
>see anything that would help me.
>
>Thanks,
>George

Hi George,

prior to updating a record, you may try to lock it with:

SELECT 1
  FROM <your table>
 WHERE <condition for the record you want to update>    FOR UPDATE NOWAIT; If the record is already locked by another user, you will receive 'ORA-00054 resource busy and acquire with NOWAIT specified' which you can catch in an exception handler.

HTH,
Peter

Peter Schneider
pschneider.ctj_at_metronet.de Received on Sun Nov 23 1997 - 00:00:00 CST

Original text of this message

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