Does MySQL auto lock rows when updating?

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-10 23:40:58

问题


I'm new to PHP development and I want to create a PHP-MySQL web-app. In this app I have the case where it is possible that at the same time I might have one "UPDATE" statement and one "SELECT" query for the same row. And here is where my question appears. Does MySQL automatically lock the row when updating so the select queries will wait for it?

If yes, will the select queries wait until the update query is ready ( transaction finished) and then execute? Or will they fail and I will have to manage in the application to re issue them?

Any suggestions on how to proceed with this case?

来源:https://stackoverflow.com/questions/15872326/does-mysql-auto-lock-rows-when-updating

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!