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: OCIStmtExecute on an update query locks...

Re: OCIStmtExecute on an update query locks...

From: Andy Hassall <andy_at_andyh.co.uk>
Date: Wed, 22 Feb 2006 18:31:07 +0000
Message-ID: <f5bpv1l612nkga8d89atrgjnoioldt6nu7@4ax.com>


On 21 Feb 2006 00:46:41 -0800, "Herode" <cbrun_at_geomapgis.com> wrote:

>Yes, you're right ! The key problem was a session started and not
>closed on a previous test. This lost session locked the rows, hence the
>OCIStmtExecute.
>Thanks !
>
>PS : One could wonder why Oracle does not deliver any error or
>information message on such occasions, instead of sticking on the
>function call... ?

 Because it's not an error that a statement has to wait for a lock. The lock will be released by the other session eventually, and so the statement can proceed.

 If you were to get into a situation where it's impossible to get a lock - i.e. a deadlock - then an error _is_ raised, as Oracle detects this.

 If you want a timeout, then you have to code it yourself, e.g. with alarm() and OCIBreak() in a SIGALRM handler, or using non-blocking mode and polling.

-- 
Andy Hassall :: andy@andyh.co.uk :: http://www.andyh.co.uk
http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool
Received on Wed Feb 22 2006 - 12:31:07 CST

Original text of this message

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