当前位置:网站首页>【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
边栏推荐
猜你喜欢
wind7 无法安装tools (问题已解决)
pdd.order.information.get拼多多订单详情接口代码对接教程
How to quickly become a software test engineer?What skills do testers need for a monthly salary of 15k?
2022年起重机械指挥操作证考试题库及模拟考试
测试工作管理与规范
【mindspore】【Categorical】softmax数据放入Categorical类出现和不为1的错误
【mindspore产品】【8卡分布式训练】davinci_model : load task fail, return ret
MindSpore官方RandomChoiceWithMask算子用例报错
请问mindspore支持l1范数归一化吗
数据切片问题
随机推荐
ZZULIOJ:1026: 字符类型判断
数据库学习真难,头大,有偿提问
[crit] 23856#0: *101796511 stat()
C语言顺序表(源码)
Dijkstra求最短路
[STL]map与set
goland json.Marshal导致&变成\u0026
互联网公司高频面试题精讲:测试计划和测试方案有什么区别?
ZZULIOJ:1025: 最大字符
线程和线程间通信(C语言)
学习总结week4_2正则
ZZULIOJ:1015: 计算时间间隔
TCP协议之《延迟ACK策略》
富媒体在客服IM消息通信中的秒发实践
数据库设计中反映用户对数据要求的模式叫什么
模型部署ONNX学习
sql注入之宽字节注入,limit,order by
如何将 @Transactional 事务注解运用到炉火纯青?
质量小议13 -- 侥幸
ZZULIOJ:1016: 银行利率