简体   繁体   English

尝试获取锁时发现死锁; 尝试重新启动事务无法与会话同步数据库状态

[英]Deadlock found when trying to get lock; try restarting transaction Could not synchronize database state with session

Deadlock found when trying to get lock; 尝试获取锁时发现死锁; try restarting transaction 尝试重新启动事务
Could not synchronise database state with session 无法将数据库状态与会话同步

org.hibernate.exception.LockAcquisitionException: Could not execute JDBC batch update. org.hibernate.exception.LockAcquisitionException:无法执行JDBC批处理更新。

This exception is occurring several times, certain documents says its related to mysql lock wait timeout, here its set to default value 50. 这个异常发生了好几次,某些文档说它与mysql锁定等待超时有关,这里将其设置为默认值50。
please give a clear answer whether the issue is actually related to lock wait timeout or anything else, and will this issue be resolved by increasing the lock wait timeout to 150 - 200. 请给出明确的答案,该问题是否实际上与锁定等待超时有关,还是其他原因,可以通过将锁定等待超时增加到150-200来解决此问题。

The deadlock condition implies that your transactions are trying to acquire lock in different order. 死锁条件意味着您的事务正在尝试以不同的顺序获取锁。 Increasing the timeout will not solve the actual problem. 增加超时将无法解决实际问题。 You can go deeper into the deadlock cause by running " SHOW ENGINE INNODB STATUS " and it will show the transactions involved in deadlock and what sql they were running. 您可以通过运行“ SHOW ENGINE INNODB STATUS ”来更深入地了解死锁的原因,它将显示涉及死锁的事务以及它们正在运行的SQL。 For more details check the docs here and helpful guide to debug deadlock issues here . 欲了解更多详细信息,请检查文档在这里和有益的指导,调试死锁问题在这里 One useful information from the docs is that one useful way to solve the deadlock is retyring too, but it is always worth to find the root cause and solve that. 文档中的一项有用信息是,解决死锁的一种有用方法也是重新键入,但始终值得找到根本原因并加以解决。

Always be prepared to re-issue a transaction if it fails due to deadlock. 如果由于死锁而失败,请始终准备重新发出事务。 Deadlocks are not dangerous. 死锁并不危险。 Just try again 再试一次

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 获取“尝试获取锁时发现死锁;尝试重新启动事务” - Getting "Deadlock found when trying to get lock; try restarting transaction" MySQLTransactionRollbackException:尝试获取锁时发现死锁; - MySQLTransactionRollbackException: Deadlock found when trying to get lock; 无法将数据库状态与会话同步 - Could not synchronize database state with session 无法在hibernate中将数据库状态与会话异常同步 - Could not synchronize database state with session Exception in hibernate Hibernate:尝试获取锁定时发现死锁 - Hibernate: Deadlock found when trying to obtain lock 无法同步数据库状态 - Could not synchronize database state 检测到死锁时,Hibernate会话不同步 - Hibernate session not synchronize when deadlock detected 如何修复 Mysql 表之前工作时的“超出锁定等待超时;尝试重新启动事务”? - How to fix "Lock wait timeout exceeded; try restarting transaction" for Mysql table when it was working before? MySQL错误:超过了锁定等待超时; 尝试重新启动事务查询 - MySQL Error: Lock wait timeout exceeded; try restarting transaction Query 由于“超过了锁定等待超时,导致事务失败; 尝试重新开始交易” - Transactions fails due to “Lock wait timeout exceeded; try restarting transaction”
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM