Skip to Main Content

DevOps, CI/CD and Automation

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Problems of locks with oci

443813May 13 2005 — edited May 19 2005
I have a problem with locks.

I try to create a lock thanks to "SELECT X FROM TAB FOR UPDATE NOWAIT".

to do this :
- I parse my query : $resource = ociparse ($onnection, "SELECT X FROM TAB FOR UPDATE NOWAIT") ;
- I execute my query : ociexecute ($resource, OCI_DEFAULT) ;
- I don't close the connection in the script.

If I use the query in SQL*PLUS and (without commit or rollback in SQL*PLUS of course) I start my php script, I obtain the ORA error which tells there is a lock etc... So all is good.

But if I start the script before, and the query in SQL*PLUS after, there is no lock created by the script. Like if there was an implicite rollback.

I don't know if it's a problem of oci, or a problem of configuration or a problem of PHP...

Reproduce code:
---------------
$connect = ociplogon($user, $password,$tns) ;
$resource = ociparse ($connect, "SELECT X FROM TAB FOR UPDATE NOWAIT") ;
ociexecute ($resource, OCI_DEFAULT) ;

Expected result:
----------------
If two scripts are executed at the same time : an oracle error in one of both script.

Actual result:
--------------
No error, and no lock created.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 16 2005
Added on May 13 2005
10 comments
862 views