Re: MySQL ResultSet - count rows?
- From: Lew <lew@xxxxxxxxxxxxx>
- Date: Thu, 13 Dec 2007 19:32:33 -0500
Arne Vajhøj wrote:
Lew wrote:Dyreatnews@xxxxxxx wrote:Ruud is making a very good point. I've just been told that the the
SELECT COUNT(*) approach will only be guaranteed to work if you execute
both SELECTs in a single transaction AND use SERIALIZABLE isolation
level. Even at REPEATABLE READ you may see new rows added since the
previous select, (but all rows counted will have the same value
throughout the transaction).
You won't "see" those new rows added until after the transaction completes.
You will.
user 1 - SELECT COUNT(*)
user 2 - INSERT
user 1 - SELECT
Only SERIALIZABLE will prevent this.
I stand corrected. Thanks, Dyreatnews and Arne.
--
Lew
.
- References:
- MySQL ResultSet - count rows?
- From: Christoph
- Re: MySQL ResultSet - count rows?
- From: Dyreatnews
- Re: MySQL ResultSet - count rows?
- From: Ruud de Koter
- Re: MySQL ResultSet - count rows?
- From: Lew
- Re: MySQL ResultSet - count rows?
- From: Dyreatnews
- Re: MySQL ResultSet - count rows?
- From: Lew
- Re: MySQL ResultSet - count rows?
- From: Arne Vajhøj
- MySQL ResultSet - count rows?
- Prev by Date: Re: MySQL ResultSet - count rows?
- Next by Date: Re: Global temporary tables in Java DB -- Apache Derby
- Previous by thread: Re: MySQL ResultSet - count rows?
- Next by thread: Re: MySQL ResultSet - count rows?
- Index(es):
Relevant Pages
|