Mysql死锁
这里先贴我的另一篇文章 https://www.cnblogs.com/zhangfengshi/p/12167957.html 详细有诠释 死锁的相关概念。 笔者最近在生产环境错误日志上看到updating database. Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLTransactionRollbackException: Deadlock found when trying to get lock; try restarting transaction 这样的日志 ,网上看了很多文章 发现这篇文章 跟自己的场景非常接近。也没像作者翻binlog日志 但综合分析我的情况应该是相同表记录行锁冲突 在我一次执行三个update table1 ,table2 set table.xx=table2.xx where .. update table1,table2 set table1.yy=table2.yy where ... update table1,table2 set table1.xx=table2.xx where ... update table1,table2 set table1.zz=table2.zz where ... 而且我的where 条件列是没有建立索引 所以锁住的是整表。 事务一直执行过程中