MySQL Verion: v5.0.95
Basically I have clients trying to get data – each client should only get unique rows.
START TRANSACTION;
SELECT id where result='new';
UPDATE SET result='old' WHERE id=$id;
COMMIT;
LOCK IN SHARED MODE on the select statement still lets other clients read the data, which seems like a problem.
Basically I need the data selected once, updated, and not read again by another client.
SELECT FOR UPDATEwill block another read, whileLOCK IN SHARED MODEwill allow the read, but won’t allow update from another client