Lock wait timeout exceeded; try restarting transaction解决方案

简介: 在测试程序时,打的断点怎么都跳不进去,console一直报 “Lock wait timeout exceeded; try restarting transaction”

在测试程序时,打的断点怎么都跳不进去,console一直报 “Lock wait timeout exceeded; try restarting transaction”


org.springframework.dao.CannotAcquireLockException: could not execute statement; SQL [n/a]; nested exception is org.hibernate.exception.LockAcquisitionException: could not execute statement。


从字面意思得知,是表锁了所以进不到断点里面,查看代码发现:

20190221194055674.png此处是在对list做更新动作,因此存在锁表的风险。


Mysql 查看锁:

select * from information_schema.innodb_trx ## 当前运行的所有事务

select * from information_schema.innodb_locks ##当前出现的锁

select * from information_schema.innodb_lock_waits ## 锁等待的对应关系。

把对应的trx_id kill掉即可。

20190221195110720.png

目录
相关文章
|
关系型数据库 MySQL 数据库
MySQL报错:Lock wait timeout exceeded; try restarting transaction
MySQL报错:Lock wait timeout exceeded; try restarting transaction
706 0
|
SQL 关系型数据库 MySQL
MySQL报错:1205 Lock wait timeout exceeded; try restarting transaction处理
MySQL报错:1205 Lock wait timeout exceeded; try restarting transaction处理
376 0
|
SQL 关系型数据库 MySQL
【MySQL异常】MySQL事务锁问题----lock wait timeout exceeded; try restarting transaction
【MySQL异常】MySQL事务锁问题----lock wait timeout exceeded; try restarting transaction
469 0
|
SQL 关系型数据库 MySQL
Mysql 异常:Lock wait timeout exceeded; try restarting transaction的解决办法
Mysql 异常:Lock wait timeout exceeded; try restarting transaction的解决办法
392 0
|
SQL 关系型数据库 MySQL
mysql Lock wait timeout exceeded; try restarting transaction解决方案
在测试程序时,打的断点怎么都跳不进去,console一直报 “Lock wait timeout exceeded; try restarting transaction”
179 0
|
SQL 关系型数据库 MySQL
Deadlock found when trying to get lock; try restarting transaction
Deadlock found when trying to get lock; try restarting transaction
332 1
|
关系型数据库 MySQL
jdbs学习中的错误总结1(MySql Lock wait timeout exceeded)
错误原因: 两个事物之间出现死锁,导致另外一个事物超时 某一种表频繁被锁表,导致其他事物无法拿到锁,导致事物超时
jdbs学习中的错误总结1(MySql Lock wait timeout exceeded)
|
Oracle 关系型数据库 数据库
innodb_lock_wait_timeout参数的了解
前言:在管理ORACLE的工作中,经常发现因为锁等待的原因导致应用宕机了。Mysql考虑到自身的性能和架构等因素,InnoDB数据库引擎增加了参数innodb_lock_wait_timeout,避免在资源有限的情况下产生太多的锁等待; 一、innodb_...
3138 0
|
关系型数据库 MySQL 数据库
MySQL - Lock wait timeout exceeded; try restarting transaction
MySQL - Lock wait timeout exceeded; try restarting transaction
474 0
MySQL - Lock wait timeout exceeded; try restarting transaction
Timeout waiting to lock artifact cache ....
Timeout waiting to lock artifact cache ....
Timeout waiting to lock artifact cache ....