@Transactional(rollbackFor= Exception.class)
时间: 2023-10-12 13:06:45 浏览: 90
Transaction.class
@Transaction(rollbackFor=Exception.class)是一个注解,用于在方法执行过程中发生异常时回滚事务。它的作用是告诉事务管理器在遇到任何类型的Exception异常时都回滚事务。这意味着无论是checked异常还是unchecked异常,都会导致方法执行过程中的事务回滚。 [2<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *2* *3* [@Transactional(rollbackFor=Exception.class)的使用](https://blog.csdn.net/weixin_44299027/article/details/95231808)[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^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 100%"]
[ .reference_list ]
阅读全文