From daemon Sat Feb 17 05:09:15 1996 Received: from ccvm.sunysb.edu by alice.jcc.com; (5.65v3.0/1.1.8.2/01Aug94-0142PM) id AA26460; Sat, 17 Feb 1996 05:09:12 -0500 Message-Id: <9602171009.AA26460@alice.jcc.com> Received: from CCVM.SUNYSB.EDU by ccvm.sunysb.edu (IBM VM SMTP V2R3) with BSMTP id 6419; Sat, 17 Feb 96 04:50:52 EST Received: from CCVM.SUNYSB.EDU (NJE origin LISTSERV@SBCCVM) by CCVM.SUNYSB.EDU (LMail V1.2a/1.8a) with BSMTP id 0349; Sat, 17 Feb 1996 04:50:50 -0500 Date: Sat, 17 Feb 1996 04:50:50 -0500 Reply-To: pt@chaff.demon.co.uk Sender: "ORACLE database mailing list." From: Peter Moore Subject: Re: FOR UPDATE and row locks X-To: ORACLE-L@ccvm.sunysb.edu To: Multiple recipients of list ORACLE-L X-Orig-Date: Fri, 16 Feb 1996 18:54:53 +0100 Mark, Are you COMMITing the update before you fetch the next row? If not, you should be! If you are...??? I know Forms3 has a strange error sometimes where a FOR UPDATE lock is not released until you exit the form or query a new row - even if the data is committed. However, I think that may be specific to the Forms3 product. On 15 Feb 96 at 15:56, Mark Wagoner wrote : > I need to lock the row in a table while I process its children rows in > another table. The reason for the lock is to let other processes know > that I am working on it. I force the lock by using the FOR UPDATE > clause. Then, once I am done with this row, I update a column > showing that it has been done and get the next row to process. The > rows needing processing are identified by the fact that the above > column is null. > > Sounds simple, but as soon as I try to start another instance of the > app, I start running into problems. It seems that, by using the FOR > UPDATE clause, Oracle makes my app wait until it can get a lock on the > row. This is sort of a double whammy because a) I don't want to wait, > since the row is already being processed I just want to get the next one, > and b) once I do get the lock, the row has already been processed by the > other instance, in which case I no longer want it anyway! > > My environment includes: Oracle 7.2 on Windows NT Server 3.51 as the server, > Visual Basic 4 Enterprise Edition using ODBC and SQL*Net 2.2 on Windows NT > Workstation 3.51 as the clients. > > Any advice/hints would really be appreciated. > -- > Mark Wagoner > mwagoner@iac.net > ------------------------------------------------------------------------ | Peter Moore - Database Administrator - MAT Transport Ltd, London, UK | pt@chaff.demon.co.uk : +44 (171) 410 6373 | "With a little study you'll go a long ways & I wish you'd start now!"