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 -> Multiple Locking of one Record in same session

Multiple Locking of one Record in same session

From: beutler <webmaster_at_beutler-muenzen.de>
Date: 26 Dec 2002 10:28:11 -0800
Message-ID: <c299fdd.0212261028.301a520d@posting.google.com>


Hello,

I'm accessing oracle via Oracle OLE Objects for C++ from a MS Visual C++ application, but I think its more a general question on locking behaviour of Oracle.
In one connections, I am creating (in 2 seperate threads) 2 recordsets, which are accessing the same table ("SELECT * FROM XY;"). Now, I'm calling StartEdit() on the dynaset (Dynasets are the classes in OO4OC++), which effectively, according to the documentation, sends an SELECT ... FOR UPDATE;, the dynaset was created with NOWAIT option, so that it will fail if the record is locked. If my 2nd thread does now exactly the same, no error is returned, it seems oracle says to me: "You have already locked this record in your session, so all is OK". Both threads will have to make different modifications to my data "in real" (above scenario that both are making the same is not what i really want, it was only for illustration). If another session on the same computer will try to lock the record, it correctly returns an error that this record is locked. Now I want to be notified if the table is locked in the SAME session, i don't want to create a lot of sessions (which is resouce-consuming, of course). Any suggestions ? or IMPOSSIBLE ? Received on Thu Dec 26 2002 - 12:28:11 CST

Original text of this message

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