Problem
The Spring AOP transaction is not working in following interceptors?
<bean id="testAutoProxyCreator"
class="org.springframework.aop.framework.autoproxy.BeanNameAutoProxyCreator">
<property name="interceptorNames">
<list>
<idref bean="urlInterceptorInsert" />
<idref bean="urlInterceptorCommit" />
<idref bean="urlInterceptorRelease" />
<idref bean="matchGenericTxInterceptor" />
</list>
</property>
<property name="beanNames">
<list>
<idref local="urlBo" />
</list>
</property>
</bean>
The “matchGenericTxInterceptor” transaction interceptor, suppose to intercept urlInterceptorInsert
, urlInterceptorCommit
,urlInterceptorRelease
, but it’s not work as expected?
Solution
The 3 interceptors are executed before transaction manager interceptor (matchGenericTxInterceptor).
To fix it, you have to change the sequence of the interceptor xml file like following (put matchGenericTxInterceptor on top).
<bean id="testAutoProxyCreator"
class="org.springframework.aop.framework.autoproxy.BeanNameAutoProxyCreator">
<property name="interceptorNames">
<list>
<idref bean="matchGenericTxInterceptor" />
<idref bean="urlInterceptorInsert" />
<idref bean="urlInterceptorCommit" />
<idref bean="urlInterceptorRelease" />
</list>
</property>
<property name="beanNames">
<list>
<idref local="urlBo" />
</list>
</property>
</bean>
Note
The sequence of Spring AOP interceptors do affect the functionality.
分享到:
相关推荐
spring aop jar 包
spring aop spring aop spring aop spring aop spring aop spring aop spring aop spring aop spring aop
描述一下Spring AOP? 在Spring AOP中关注点(concern)和横切关注点(cross-cutting concern)有什么不同? AOP有哪些可用的实现? Spring中有哪些不同的通知类型(advice types)? Spring AOP 代理是什么? 引介...
spring-aop-1.1.1.jar spring-aop-1.2.6.jar spring-aop-1.2.9.jar spring-aop-2.0.2.jar spring-aop-2.0.6.jar spring-aop-2.0.7.jar spring-aop-2.0.8.jar spring-aop-2.0.jar spring-aop-2.5.1.jar spring-aop-...
SpringAOP与SpringMVC拦截器两种方式实现权限管控,前台xml读取配置根据登录用户判断button是否enable
一、适合人群 1、具备一定Java编程基础,初级开发者 2、对springboot,mybatis,mysql有基本认识 3、对spring aop认识模糊的,不清楚如何实现Java 自定义注解的 ...4、spring boot,mybatis,druid,spring aop的使用
基于注解实现SpringAop基于注解实现SpringAop基于注解实现SpringAop
springaop依赖的jar包,spring版本2.5.6,如果需要,可以下载使用,欢迎各位评论指出不足
死磕Spring之AOP篇 - Spring AOP两种代理对象的拦截处理(csdn)————程序
Spring框架的关键组件之一是面向方面编程(AOP)框架。 面向方面的编程需要将程序逻辑分解成不同的部分。 此教程将通过简单实用的方法来学习Spring框架提供的AOP/面向方面编程。
spring aop的demo spring aop的demo
AOP流程源码分析-SpringAOP中定义的类图AOP流程源码分析-SpringAOP中定义的类图AOP流程源码分析-SpringAOP中定义的类图AOP流程源码分析-SpringAOP中定义的类图AOP流程源码分析-SpringAOP中定义的类图AOP流程源码分析...
spring aop切面拦截指定类和方法实现流程日志跟踪 一般情况下,在不侵入业务代码的情况下,需要做流程日志跟踪是比较合理的 采用springaop切面思想
Spring AOP 几个不同使用方法的完整例子,使用Junit4c测试, 在我的博客上有不同配置组合的说明,可以参考
Spring aop Spring aop
AOP的意思就是面向切面编程。本文主要是通过梳理JDK中自带的反射机制,实现 AOP动态代理模式,这也是Spring AOP 的实现原理
NULL 博文链接:https://306963591.iteye.com/blog/1129837
springAOP所需jar包 springAOP所需jar包 springAOP所需jar包 springAOP所需jar包 springAOP所需jar包
Spring AOP的实现机制中文版,动态代理及原理,自定义类加载器
Spring AOP简单demo 入门级的 advice