Re: Question on select count()

From: Alex Filonov <afilonov_at_yahoo.com>
Date: 16 Aug 2004 12:50:13 -0700
Message-ID: <336da121.0408161150.2c0d78d9_at_posting.google.com>


jpbelang_at_hotmail.com (JP Belanger) wrote in message news:<b399d6ce.0408131002.26efbf79_at_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 ?

If you are trying to restrict number of rows to <= 50, there is something wrong with database design. It'll help if you post what you are trying to achieve (in simple words)... Received on Mon Aug 16 2004 - 21:50:13 CEST

Original text of this message