实现类添加了@Transactional
时间: 2023-10-15 08:29:55 浏览: 83
spring-@Transactional-jar
当我们在实现类上添加了@Transactional注解时,表示该类的方法将被包装成一个事务。这样,在方法执行期间,将会启动一个事务,并在方法执行结束后,根据方法的执行结果决定是提交事务还是回滚事务。注意,Spring团队建议将@Transactional注解添加在具体的类(或类的方法)上,而不是接口上。因为注解不能继承,如果使用基于类的代理,那么在接口上使用@Transactional注解将不会生效。所以,请遵循Spring团队的建议,在具体的类上使用@Transactional注解。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* [基于框架的Web开发-基于注解的事务配置.doc](https://download.csdn.net/download/u011062044/85897798)[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: 33.333333333333336%"]
- *2* [@Transactional 详解](https://blog.csdn.net/loveLifeLoveCoding/article/details/114153645)[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: 33.333333333333336%"]
- *3* [关于@Transactional的使用](https://blog.csdn.net/OUCFSB/article/details/126121337)[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: 33.333333333333336%"]
[ .reference_list ]
阅读全文