On Feb 12, 2008 12:28 PM, Frederic Belleudy <[EMAIL PROTECTED]> wrote:
> select video_id from videos_innodb where state='QUEUE' limit 10 FOR UPDATE;
> => it's waiting for the first to session to commit, so I cannot get
> other videos with the same state!!
>
> commit;
>         => I get 10 video_id....
>
>
> How can I tell mysql to lock only rows that are selected and allow other
> sessions to query the table without be locking on the entire table?

It is only locking the rows it selected.  Your problem is that both
queries select the same rows.  The common way to handle this is to
change the state of the rows to something else like 'PROCESSING' in
order to remove them from the queue.

- Perrin

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

Reply via email to