Re: MySQL ResultSet - count rows?
- From: Arne Vajhøj <arne@xxxxxxxxxx>
- Date: Thu, 13 Dec 2007 15:49:41 -0500
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.
Arne
.
- Follow-Ups:
- Re: MySQL ResultSet - count rows?
- From: Lew
- Re: MySQL ResultSet - count rows?
- From: Ruud de Koter
- Re: MySQL ResultSet - count rows?
- 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
- MySQL ResultSet - count rows?
- Prev by Date: Re: MySQL ResultSet - count rows?
- Next by Date: Re: MySQL ResultSet - count rows?
- Previous by thread: Re: MySQL ResultSet - count rows?
- Next by thread: Re: MySQL ResultSet - count rows?
- Index(es):
Relevant Pages
|