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: How To Set Lock TimeOut?

Re: How To Set Lock TimeOut?

From: Thomas Kyte <tkyte_at_us.oracle.com>
Date: Fri, 12 Nov 1999 07:39:42 -0500
Message-ID: <OQosOFW9xuK68m7IfKCoKtewcNuD@4ax.com>


A copy of this was sent to "Robert Drinovac" <rdrinova_at_invatron.com> (if that email address didn't require changing) On Thu, 11 Nov 1999 23:31:34 GMT, you wrote:

>I am currently connecting to a Oracle 7.2 database using ODBC. Is there a
>way to set the Lock Timeout from my application (i.e. through the use of a
>SQL statement) that will allow the application to set the duration that the
>database will wait to execute a statement on a table that has been locked by
>another process. Ideally, I would want to be able to set the lock timeout
>for the duration of the connection so that it either waits forever for the
>lock to clear, instantly times out, or waits for a specified duration before
>it times out.
>
>Thanks in advance to anyone who responds.

No, you can either have a statement block or not block.

If you want to submit an update and not have the update block, you can:

select * from T where x=5 for update NOWAIT; if no error then

        update T set c1 = y where x = 5;
end

Else the update will wait for the rows to become available (block).

--
See http://osi.oracle.com/~tkyte/ for my columns 'Digging-in to Oracle8i'... Current article is "Part I of V, Autonomous Transactions" updated June 21'st  

Thomas Kyte                   tkyte_at_us.oracle.com
Oracle Service Industries     Reston, VA   USA

Opinions are mine and do not necessarily reflect those of Oracle Corporation Received on Fri Nov 12 1999 - 06:39:42 CST

Original text of this message

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