|
-
Jul 22nd, 2007, 05:40 PM
#9
Thread Starter
No place like 127.0.0.1
Re: [RESOLVED] Locking a row from being READ
Alright. I realized I have another problem. If I need to do this multiple rows, the idea breaks down. Example:
SELECT * FROM artists WHERE status='todo' LIMIT 100;
UPDATE artists SET status='in_processing' WHERE id IN (SELECT id FROM artists WHERE status='todo' LIMIT 100);
I can't just check to make sure that the number of updates rows was equal to the number of rows selected. Well, I can check for it, but it is costly to just keep re-performing the query until they are equal.
Does that make sense?
In PHP, I can't easily do a multi-query, so I have to do those queries separately and before I do the second one, there is a chance that one of the other asynchronous copies of this script could SELECT the same 100 for processing.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|