尝试获取锁时发现死锁;尝试重新启动事务;

时间:2019-03-07 06:18:40

标签: spring-boot deadlock database-deadlocks

我的代码中出现此错误。我试图在表上运行更新查询。有哪些临时和永久解决方案?

我在Spring Boot中使用mysql。

    [2019-03-07 05:43:03] [E] [pool-3-thread-2] [UserDaoImpl] Error occurred while writing to database
org.springframework.dao.DeadlockLoserDataAccessException: PreparedStatementCallback; SQL [UPDATE user_data SET rece_num = ?, first_name = ?, last_name = ? where user_id = ?]; Deadlock found when trying to get lock; try restarting transaction; nested exception is com.mysql.cj.jdbc.exceptions.MySQLTransactionRollbackException: Deadlock found when trying to get lock; try restarting transaction

0 个答案:

没有答案