MySQL Forums
Forum List  »  Newbie

row-level lock that prevents SELECT?
Posted by: peter andrus
Date: November 02, 2012 01:33PM

I apologize if i already posted this. i thought i did, but subsequent search turned up empty... so here goes again....

I have several servers that will be querying a mySQL database looking for rows where column 'status' = 'waiting'.

i would like to be able to make it so that when server 1 queries and finds a row that the row will not be selectable by another server. is this possible?

1-server 1 queries and locks row 1
2-server 2 queries and DOES NOT SELECT row 1, it instead gets row 2 and locks it.
3-server 1 updates status = 'running', and unlocks row 1
4-server 3 queries and gets row 1, but status='running'.

will that work? am i nuts? thanks!

Options: ReplyQuote

Written By
row-level lock that prevents SELECT?
November 02, 2012 01:33PM

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.