开发者

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜