Question on select count()
From: JP Belanger <jpbelang_at_hotmail.com>
Date: 13 Aug 2004 11:02:51 -0700
Message-ID: <b399d6ce.0408131002.26efbf79_at_posting.google.com>
I have a question on select count(), which may betray my lack of database knowledge. Here goes.
Date: 13 Aug 2004 11:02:51 -0700
Message-ID: <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 ? Received on Fri Aug 13 2004 - 20:02:51 CEST