数据库死锁这个问题不知道你有没有遇到过呢?一旦遇到该如何排查问题呢?
环境: MySQL 5.7.25 引擎 InnoDB
如果你的系统日志突然报这种错误,就问你慌不慌?心想:MD,之前遇到过,但完全不记得该怎么办了!!!完了完了!被领导知道我解决不了这个问题,不会被开除吧!
2019-10-23 13:07:17.144 ERROR nested exception is org.springframework.dao.DeadlockLoserDataAccessException:
### Error updating database. Cause: com.mysql.cj.jdbc.exceptions.MySQLTransactionRollbackException: Deadlock found when trying to get lock; try restarting transaction
### The error may involve com.x.x.mapper.XMapper.update-Inline
### The error occurred while setting parameters
### SQL: UPDATE tb_a SET start_time = ?, end_time = ? WHERE id = ?
### Cause: com.mysql.cj.jdbc.exceptions.M