MySQL Forums :: Newbie :: row-level lock that prevents SELECT?


Advanced Search

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?

so...
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


Subject Written By Posted
row-level lock that prevents SELECT? peter andrus 11/02/2012 01:33PM
Re: row-level lock that prevents SELECT? Peter Brawley 11/03/2012 09:51AM
Re: row-level lock that prevents SELECT? Rick James 11/03/2012 03:55PM
Re: row-level lock that prevents SELECT? Javin Paul 11/03/2012 11:35PM
Re: row-level lock that prevents SELECT? Peter Brawley 11/04/2012 08: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.