Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> Re: FOR UPDATE and row locks

Re: FOR UPDATE and row locks

From: Peter Moore <pt_at_CHAFF.DEMON.CO.UK>
Date: Sat, 17 Feb 1996 04:50:50 -0500
Message-Id: <9602171009.AA26460@alice.jcc.com>


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_at_iac.net
>


|  Peter Moore - Database Administrator - MAT Transport Ltd, London, UK
|  pt_at_chaff.demon.co.uk : +44 (171) 410 6373
|  "With a little study you'll go a long ways & I wish you'd start now!"

Received on Sat Feb 17 1996 - 05:09:15 CST

Original text of this message

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