当前位置:网站首页>Transaction rolled back because it has been marked as rollback-only解决
Transaction rolled back because it has been marked as rollback-only解决
2022-07-07 08:45:00 【自由_free】
项目中遇到Transaction rolled back because it has been marked as rollback-only错误
- 不要想 就是遇到了事物嵌套,即使你把所有方法上的@Transactional注解全部删除,仍会出现该错误
- 原因是,你某一个代码块使用了try catch
- 解决方法

- 这样就解决了,建议不要在service使用try catch,要是cation中throw RuntimeException也可以解决
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
边栏推荐
- 在线硬核工具
- 施努卡:机器视觉定位技术 机器视觉定位原理
- [pytorch 07] hands on deep learning chapter_ Preliminaries/ndarray exercises hands-on version
- Find the root of equation ax^2+bx+c=0 (C language)
- 软考中级电子商务师含金量高嘛?
- Cluster task scheduling system lsf/sge/slurm/pbs based on HPC scenario
- Online hard core tools
- 多线程-异步编排
- [daiy5] jz77 print binary tree in zigzag order
- 【推荐系统 02】DeepFM、YoutubeDNN、DSSM、MMOE
猜你喜欢

【STM32】实战3.1—用STM32与TB6600驱动器驱动42步进电机(一)
![P1031 [noip2002 improvement group] average Solitaire](/img/ba/6303f54d652fa7aa89440e314f8718.png)
P1031 [noip2002 improvement group] average Solitaire

单调性约束与反单调性约束的区别 monotonicity and anti-monotonicity constraint

软考中级,软件设计师考试那些内容,考试大纲什么的?

July 10, 2022 "five heart public welfare" activity notice + registration entry (two-dimensional code)

seata 1.3.0 四种模式解决分布式事务(AT、TCC、SAGA、XA)

Cluster task scheduling system lsf/sge/slurm/pbs based on HPC scenario

IO model review

【实战】霸榜各大医学分割挑战赛的Transformer架构--nnFormer

The difference between monotonicity constraint and anti monotonicity constraint
随机推荐
Prototype and prototype chain
BUUCTF---Reverse---reverse1
ThreadLocal会用可不够
软考中级电子商务师含金量高嘛?
leetcode-304:二维区域和检索 - 矩阵不可变
SQL Server 知识汇集11 : 约束
[dai6] mirror image of JZ27 binary tree
Leetcode-560: subarray with sum K
中级软件评测师考什么
Arduino receives and sends strings
PHP \ newline cannot be output
TypeScript 接口继承
1323: [example 6.5] activity selection
Applet jump to H5, configure business domain name experience tutorial
JS实现链式调用
Différences entre les contraintes monotones et anti - monotones
路由器开发知识汇总
Gym installation pit records
SQL Server knowledge collection 11: Constraints
2022.7.6DAY598