- @Component VS @Configuration
- @Controller @Service @Repository 区别,本质
- ApplicationContext的层次结构,继承关系
- @PostConstruct
- <aop:advisor>及<aop:aspect>
- Spring事务不支持远程调用的场景,如有此需求,应当使用EJB。
- Spring事务默认只回滚未检查异常及错误,默认不会滚检查异常。
- @Transactional只能作用于public方法,而private、protected方法不产生作用。
- @Transactional可以放在接口定义、接口方法、类定义或者类的public方法之上;
- @Transactional如果放在接口之上,然而代理中却配置了proxy-target-class=“true”或者mode=“aspectj",那么该配置将无法产生作用。
- @Transactional 中的mode可选proxy、aspectj,前者是只通过方法调用的代理,后者是通过修改字节码
- Spring事务与自我调用:
- Spring事务中需要区分:物理事务及逻辑事务
- PROPAGATION_REQUIRED
- PROPAGATION_REQUIRED_NEW
- PROPAGATION_NESTED 匹配JDBC保存点,参考Spring的DataSourceTransactionManager
- 编程式事务:TransactionTemplate 及 PlatformTransactionManager
- 事务绑定事件:@TransactionEventListener
SpringBoot官方文档笔记
原文:https://www.cnblogs.com/cheungchein/p/9882837.html