- 使用 Innodb 引擎
- 主键明确 与否
主键明确where id = #{id} for update
行锁
主键不明确where id <> #{ id} for update
发生表锁
主键不明确where id like #{id} for update
发生表锁
无主键where name =#{name} for update
name 不是主键,发生表锁
使用 MySQL的行锁要注意的地方
最新推荐文章于 2024-09-15 22:39:13 发布
where id = #{id} for update
行锁where id <> #{ id} for update
发生表锁where id like #{id} for update
发生表锁where name =#{name} for update
name 不是主键,发生表锁