AOP事务监控与手动开启事务冲突解决
1.问题描述: AOP事务监控的代码生效(开关开启)后,因为使用了如下内容对事务进行拦截 @Pointcut("@annotation(org.springframework.transaction.annotation.Transactional) || execution(* org.springframework.transaction.support.TransactionTemplate.execute(..))") public void pointcut() { } 因为需要监控手动开启的事务比如MQL的事务,所以需要通过execution(* org.springframework.transaction.support.TransactionTemplate.execute(..)表达式表达手动事务的监控 因为AOP时基于动态代理来实现的,所以再开启代码后会对TransactionTemplate类实现一个同接口下的代理类,TransactionTemplate实现了TransactionDefinition接口 因此在使用Spring IOC容器管理Bean对象T....