I'm planning on a multithreaded application to get 1 row from MySQL, process data & save it. processing data takes about 10开发者_Go百科 seconds for each row & there are millions of rows and growing.
I want to select row & update status
column to prevent other threads to access the row.
But, in this short time that two queries are executing, other threads can access the row and using a multiquery or row locking cant prevent them.
How can i lock a row that other threads don't access to read that? Is it possible in MySQL? if not, which Database can I use instead?
MySQL Reference Manual :: SELECT .. FOR UPDATE and SELECT .. LOCK IN SHARE MODE Locking Reads
精彩评论