spring 事务

 

 

 

 

在调用service对象之前,CglibAopProxy.DynamicAdvisedInterceptor#intercept会拦截所有动态代理bean,并查找将要调用的方法前是否有其他AOP拦截

有@Transaction注解的时候, chain不是空的,走if else方法

没有@Transaction并且不是public方法,走if内直接调用

 

else方法中proceed调用org.springframework.transaction.interceptor.TransactionAspectSupport#invokeWithinTransaction

 

 tm transactionManager会getConnection beginTransaction

 

posted @ 2018-08-28 21:33  funny_coding  阅读(110)  评论(0编辑  收藏  举报
build beautiful things, share happiness