报错信息
org.springframework.dao.CannotAcquireLockException: Hibernate operation: could not execute update query; SQL [xxxxxxxx]; Lock wait timeout exceeded; try restarting transaction; nested exception is java.sql.SQLException: Lock wait timeout exceeded; try restarting transaction
报错原因
MySQL的事务产生了死锁 。
解决方案
1、查询线程id
select trx_mysql_thread_id from information_schema.innodb_trx;
得到的就是线程的id
2、kill 线程的id
kill trx_mysql_thread_id;