MySQL Forums
Forum List  »  Newbie

Locking tables for SELECTs only
Posted by: Tyler Hall
Date: July 27, 2014 07:42AM

I have a queuing system where multiple boxes all try to grab requests from the master MySQL server.

The problem is that these boxes are grabbing them at the exact same time, getting the same data as another box, causing duplicate work to be preformed.

I could do a RAND on the select, but I prefer it always grab the oldest entry in the queue that isn't processing, so I was wondering if there was a way to LOCK a table for read only, so as a request came in, I would lock table, grab the entry, delete it, unlock.

Thanks.

Options: ReplyQuote


Subject
Written By
Posted
Locking tables for SELECTs only
July 27, 2014 07:42AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.