springboot事务回滚
时间: 2023-08-29 19:11:23 浏览: 113
SpringBoot事务使用及回滚实现代码详解
5星 · 资源好评率100%
在Spring Boot中,可以通过在Service实现层的方法上添加@Transactional注解来开启事务。但是默认情况下,@Transactional注解只会捕捉RuntimeException和Error异常,对于Exception异常需要手动捕捉才能使@Transactional注解生效。如果不手动捕捉Exception异常,@Transactional注解将失效。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *2* *3* [Springboot基础系列:事务回滚](https://blog.csdn.net/Xin_101/article/details/109183566)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT0_1"}}] [.reference_item style="max-width: 100%"]
[ .reference_list ]
阅读全文