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态了,不知道为什么。

 

posted on 2018-10-26 18:57  一个很帅的男人  阅读(2045)  评论(0编辑  收藏  举报

导航