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

Home -> Community -> Usenet -> c.d.o.server -> Re: multiple threads select rows with row locking

Re: multiple threads select rows with row locking

From: Alex Filonov <afilonov_at_yahoo.com>
Date: 11 Apr 2003 09:21:14 -0700
Message-ID: <336da121.0304110821.38f03c69@posting.google.com>


rgparkins_at_hotmail.com (richard) wrote in message news:<84dcd46.0304101250.140df948_at_posting.google.com>...
> Hello,
>
> I am developing an application that has multiple threads accessing a
> single database table. The table is being populated at a high rate,
> therefore each thread will perfom a SELECT of a limited amount of
> rows.
>
> How do I get each thread to select rows that have not been locked. The
> first thread runs then any subsequent thread has the Exception
> generated to indicate that rows have been locked. Can I not presume
> that each thread will select rows that have not been locked without
> throwing an exception?
>

You can select rows which are locked. You can't lock them, true, but it's a different question.

If you want to lock (select for update, update or delete statements) a row, there is no way to know if it's locked already. That is, unless you use "select for update nowait" and catch the exception.

> Also can the locked row be deleted without performing a commit or
> rollback?
>

Sure. But the result of delete operation is visible only for the session which deleted the row, until commit.

> Starting to annoy me. Thanks for any responses.
>
> richard
Received on Fri Apr 11 2003 - 11:21:14 CDT

Original text of this message

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