A program will SELECT several records from a table and update each row, while it can be executed many times, which will lead to several process will complete the same task simultaneously.
How can I prevent two different processes to update the same row in the table. That's to say, how can I ensure each process can SELECT different records? Is there any locks on row-select level in MySQL? Or in this situation, is there any better solution to prevent a single row updating for many times?
use lock in share mode
won't prevent another process to get the same row, but just lock it for not updating and deleting. – Arezzinistatus
field has been changed? – Arezzini