当前位置:网站首页>【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
边栏推荐
猜你喜欢

Flink CDC介绍和个人理解

请问mindspore支持l1范数归一化吗

Day14/15/16:哈夫曼树、哈弗曼编码(压缩与解压缩)

It's almost 35, still "did a little"?What happened to the test workers who had been in the industry for a few years?

2022华数杯思路分析

GBase 8s打开工具就报错“配置文件有误” !!!为什么

ES高亮显示语法

How to quickly become a software test engineer?What skills do testers need for a monthly salary of 15k?

maya视图如何切换

互联网公司高频面试题精讲:测试计划和测试方案有什么区别?
随机推荐
sql优化
【MindSpore功能】运行SSD-MobileNetV1 FPN样例报错
ZZULIOJ:1028: I love 闰年!
RoyalScope分析仪:CAN总线波形台阶和信号幅值低的问题
微信小程序相互跳转如何携带参数
创意优选技术
GBase 8s打开工具就报错“配置文件有误” !!!为什么
测试常见问题100类(1)
使用 requestAnimationFrame 提升 web 性能
torch.nn.CrossEntropyLoss()对应的MindSpore算子是哪个?
Embedded Sharing Collection 32
全面深入了解什么是反向代理和负载均衡
shell三剑客之sed命令
【单调栈】【概念讲解&&模板代码】
How does a new tester do functional testing?Test thinking is really important
BFF避坑指南
goland json.Marshal导致&变成\u0026
maya图片如何渲染
TCP协议之《发送缓存控制tcp_notsent_lowat》
TCP协议之《TSQ限值tcp_limit_output_bytes》