Simultaneous SELECT and UPDATE - Locking to prevent concurrency problems
So I'm working in an environment with high concurrency. What I want to do is select a row from the mysql database based on a certain property and then once I have that row, I want to set a "locked" flag in the row so I can do some work in php (which could take some time) and then unlock it when I'm done. What is the best way to do this in order to prevent c开发者_开发技巧oncurrency problems that arise when having a separate SELECT and UPDATE command?
using the select for update command : http://dev.mysql.com/doc/refman/5.1/en/innodb-locking-reads.html
精彩评论