Spring AOP Interceptor transaction is not working
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 Interceptor transaction is not working的更多相关文章
- 从零开始学 Java - Spring AOP 实现用户权限验证
		
每个项目都会有权限管理系统 无论你是一个简单的企业站,还是一个复杂到爆的平台级项目,都会涉及到用户登录.权限管理这些必不可少的业务逻辑.有人说,企业站需要什么权限管理阿?那行吧,你那可能叫静态页面,就 ...
 - 从零开始学 Java - Spring AOP 拦截器的基本实现
		
一个程序猿在梦中解决的 Bug 没有人是不做梦的,在所有梦的排行中,白日梦最令人伤感.不知道身为程序猿的大家,有没有睡了一觉,然后在梦中把睡之前代码中怎么也搞不定的 Bug 给解决的经历?反正我是有过 ...
 - s2sh框架搭建(基于spring aop)
		
对于spring aop 是如何管理事务的,请看一下:http://bbs.csdn.net/topics/290021423 1.applicationContext.xml <?xml ve ...
 - Spring AOP 详解
		
AOP使用场景 AOP用来封装横切关注点,具体可以在下面的场景中使用: Authentication 权限 Caching 缓存 Context passing 内容传递 Error handling ...
 - Spring AOP简介
		
AOP简述 AOP的概念早在上个世纪九十年代初就已经出现了,当时的研究人员通过对面向对象思想局限性的分析研究出了一种新的编程思想来帮助开发者减少代码重复提高开发效率,那就是AOP,Aspect-Ori ...
 - Spring AOP: Spring之面向方面编程
		
Spring AOP: Spring之面向方面编程 面向方面编程 (AOP) 提供从另一个角度来考虑程序结构以完善面向对象编程(OOP). 面向对象将应用程序分解成 各个层次的对象,而AOP将程序分解 ...
 - Java - Spring AOP 拦截器的基本实现
		
一个程序猿在梦中解决的 Bug 没有人是不做梦的,在所有梦的排行中,白日梦最令人伤感.不知道身为程序猿的大家,有没有睡了一觉,然后在梦中把睡之前代码中怎么也搞不定的 Bug 给解决的经历?反正我是有过 ...
 - Spring 4 官方文档学习(六)核心技术之Spring AOP
		
目录 1.介绍 1.1.AOP概念 1.2.Spring AOP 能力 和 目标 1.2.1.简介 1.2.2.@AspectJ 支持 1.2.3.声明一个aspect 例子 1.2.4.声明advi ...
 - Spring学习总结(15)——Spring AOP 拦截器的基本实现
		
一个程序猿在梦中解决的 Bug 没有人是不做梦的,在所有梦的排行中,白日梦最令人伤感.不知道身为程序猿的大家,有没有睡了一觉,然后在梦中把睡之前代码中怎么也搞不定的 Bug 给解决的经历?反正我是有过 ...
 
随机推荐
- iosblock用法
			
看了很多的block用法,还是小糊涂. 最后还是自己尝试吧. #import "FirstViewController.h" @interface FirstViewControl ...
 - GridView官方教程及示例
			
Grid View GridView is a ViewGroup that displays items in a two-dimensional, scrollable grid. The gri ...
 - git branch
			
使用git管理工具,branch 应该是我们接触最多的.不论我们是修复bug,还是做项目,都会新开branch,工作完成后再合并. 然而对一些初学者,对git的一些命令知之甚少,这里,给大家写一些常用 ...
 - Android ContentProvider和Uri详解 (绝对全面)
			
ContentProvider的基本概念 : 1.ContentProvider为存储和读取数据提供了统一的接口 2.使用ContentProvider,应用程序可以实现数据共享 3.andr ...
 - POJ 2752 (KMP 所有可能长度的前缀后缀) Seek the Name, Seek the Fame
			
题意: 求一个字符串的相同前缀后缀的所有可能的长度,这里该字符串其本身也算自己的前缀和后缀. 分析: 我们知道next数组的性质是,该字符之前的字符串的最大相同前缀后缀. 既然知道了最大的,即next ...
 - css虚线和css双实线
			
border线型主要有:1.dotted[点状]2.solid[实线] 3.double[双实线] 4.dashed;[虚线] 如果一个CSS这样写:border-style:dotted solid ...
 - sql server删除数据后空间无变化处理方法
			
删除数据库表 第一步: 执行 delete from doc.115sou.com #删除数据,执行效率低 drop table doc.115sou.com #删除表 ...
 - TCP/IP详解学习笔记(2)-数据链路层
			
数据链路层有三个目的: 为IP模块发送和 接收IP数据报. 为ARP模块发送ARP请求和接收ARP应答. 为RARP发送RARP请 求和接收RARP应答 ip大家都听说过.至于ARP和RARP,ARP ...
 - Storm入门教程 第三章Storm集群安装部署步骤、storm开发环境
			
一. Storm集群组件 Storm集群中包含两类节点:主控节点(Master Node)和工作节点(Work Node).其分别对应的角色如下: 主控节点(Master Node)上运行一个被称为N ...
 - 大数据性能调优之HBase的RowKey设计
			
1 概述 HBase是一个分布式的.面向列的数据库,它和一般关系型数据库的最大区别是:HBase很适合于存储非结构化的数据,还有就是它基于列的而不是基于行的模式. 既然HBase是采用KeyValue ...