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

Home -> Community -> Usenet -> comp.databases.oracle -> Question on select count()

Question on select count()

From: JP Belanger <jpbelang_at_hotmail.com>
Date: 13 Aug 2004 11:02:51 -0700
Message-ID: <b399d6ce.0408131002.26efbf79@posting.google.com>


I have a question on select count(), which may betray my lack of database knowledge. Here goes.

I have java code driving a transaction which goes like this:

select count(*) from table

(Java code in the same transaction)
if count < 50 then ...

insert into table values(blahblah)
commit;

it seems that if many of these transactions are running concurrently, count could exceed 50 unless oracle locks the table for inserts or deletes.

Am I getting this wrong ? Are there better solutions ? Received on Fri Aug 13 2004 - 13:02:51 CDT

Original text of this message

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