当前位置:网站首页>【bug】尝试重新启动事Deadlock found when trying to get lock; try restarting transaction
【bug】尝试重新启动事Deadlock found when trying to get lock; try restarting transaction
2022-08-10 03:43:00 【掘金者说】
出现问题
### Error updating database. Cause: com.mysql.cj.jdbc.exceptions.MySQLTransactionRollbackException: Deadlock found when trying to get lock; try restarting transaction
### Cause: com.mysql.cj.jdbc.exceptions.MySQLTransactionRollbackException: Deadlock found when trying to get lock; try restarting transaction
解决思路
刚开始一直考虑的是插入那边为什么一直为空指针,没有去考虑为何出现错乱,我在查询接口那边加了syncronized把错乱的问题解决了。后来突然想到错乱是因为出现脏读,我就有一种拨开云雾见青天的感觉,我就顺着事务方向去解决,我在接口那边的事务上调整事务的隔离级别(@Transactional(isolation =Isolation.READ_COMMITTED, propagation = Propagation.REQUIRED))。终于经过自己不断地寻找问题根源,不断地尝试找到了解决办法。
原文链接
高并发场景下MySQL报Deadlock found when trying to get lock; try restarting transaction问题解决
————————————————
原文链接:https://blog.csdn.net/wts563540/article/details/124946676
边栏推荐
猜你喜欢

【网络迁移】Pytorch中的torch.is_tensor对应MindSpore哪个接口

Take you to an in-depth understanding of the version update of 3.4.2, what does it bring to users?

超全面的Android面试题汇总

The same is a primary test, why does he pay 5,000 yuan more than me?

【网络迁移】Pytorch中的torch.no_grad对应MindSpore哪个方法

进入Mysql数据库操作

PID与ADRC

C语言顺序表(源码)

整理零碎东西

js原型和原型链以及原型继承
随机推荐
125. 耍杂技的牛
Kotlin协程:父子协程的绑定与传递
2022年危险化学品经营单位主要负责人题库及模拟考试
golang:base64编解码(转)
No ‘Access-Control-Allow-Origin‘ header is present on the requested resource.
【mindspore】【Categorical】softmax数据放入Categorical类出现和不为1的错误
一篇文章教你Pytest快速入门和基础讲解,一定要看
自定义训练,使用Generator dataset迭代数据报错
请教各位confluence部署连接数据库成功,但是在后面建表设置的时候报错
golang go get 时提示 no Go files in xxx
结构体的内存对齐问题
ZZULIOJ:1026: 字符类型判断
Did not detect default resource location for test class xxxx
goland json.Marshal导致&变成\u0026
TCP协议之《TSQ控制》
ZZULIOJ:1013: 求两点间距离
RoyalScope分析仪:CAN总线波形台阶和信号幅值低的问题
【2022河南萌新联赛第(五)场:信息工程大学】【部分思路题解+代码解析】
富媒体在客服IM消息通信中的秒发实践
798. 差分矩阵