Error updating database. Cause:java.sql.SQLException: Lock wait timeout exceeded; try restartingtransaction

select * from information_schema.innodb_trx
查看 trx_mysql_thread_id

show processlist
kill 100070;

引起的问题:并发下spring事务造成了死锁。

为什么会造成死锁呢?

start transaction;
update yrProduction SET productQuotedPrice = 100 WHERE recId = 1;
COMMIT;

开启事务但是不提交,另外再开启事务,会等待,然后等待一会变running态了,不知道为什么。

猜你喜欢

转载自www.cnblogs.com/slhzxm16/p/9858191.html
今日推荐