当前位置:网站首页>【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
边栏推荐
猜你喜欢
随机推荐
质量小议13 -- 侥幸
order by注入与limit注入
pdd.order.information.get拼多多订单详情接口代码对接教程
ZZULIOJ:1020: 两整数排序
Haproxy搭建Web群集
ZZULIOJ:1026: 字符类型判断
mindspore安装过程中报错cannot find zlib
长沙:借网红的风,铺长红的路
js原型和原型链以及原型继承
TCP协议之《发送缓存控制tcp_notsent_lowat》
数据库学习真难,头大,有偿提问
模型部署ONNX学习
学习总结week4_1json
mindspore gpu版本安装问题
Qt编写物联网管理平台50-超强跨平台
使用 requestAnimationFrame 提升 web 性能
No ‘Access-Control-Allow-Origin‘ header is present on the requested resource.
RoyalScope分析仪:发现CAN总线波形台阶和信号幅值低的问题
GBase 8s打开工具就报错“配置文件有误” !!!为什么
ZZULIOJ:1029: 三角形判定









