In article <[EMAIL PROTECTED]>,
Julien ALLANOS <[EMAIL PROTECTED]> writes:

> Well, I've tried the following scenario:

> 1/ User A: SET GLOBAL TRANSACTION ISOLATION LEVEL READ COMMITTED;
> 2/ User B: SET GLOBAL TRANSACTION ISOLATION LEVEL READ COMMITTED;
> 3/ User A: START TRANSACTION;
> 4/ User B: START TRANSACTION;
> 5/ User A: SELECT * FROM MyTable LIMIT = 1 ORDER BY pkey FOR UPDATE;
> I got a one-row result.
> 6/ User B: SELECT * FROM MyTable LIMIT = 1 ORDER BY pkey FOR UPDATE;
> I got the same one-row result again!

> B isn't blocked and gets the same result than A, though A hasn't
> commited/rollbacked yet.

That's probably because you changed the transaction isolation level.
Just leave it at repeatable-read, and B will block.

By the way, your SELECT syntax is wrong.  You need

  SELECT * FROM MyTable ORDER BY pkey LIMIT 1 FOR UPDATE

> Furthermore, I don't want B to be blocked: I want B to get the
> "next" result while A is processing data and deleting the current
> row.

I don't know any way how to get this.  That's why I proposed to do the
data processing after the DELETE and COMMIT which means that B will
get blocked only for a few microseconds or so.


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to