Spring通过aop配置事物隔离级别,用xml方式配置Read Uncommitted不生效

1:用xml的方式配置事物隔离级别,Read Uncommitted不生效

	<tx:advice id="txAdvice" transaction-manager="transactionManager">
		<tx:attributes>
			<tx:method name="get*" propagation="REQUIRED" read-only="true" />
			<tx:method name="find*" propagation="REQUIRED" read-only="true" />
			<tx:method name="query*" propagation="REQUIRED" read-only="true" />
			<tx:method name="load*" read-only="true" />
			<tx:method name="*Event" read-only="true" />
			<tx:method name="*Task" read-only="true" />
			<tx:method name="barrier*" isolation="READ_UNCOMMITTED" />
			<tx:method name="read*" isolation="READ_UNCOMMITTED" />
			<tx:method name="sync*" propagation="NEVER" />
			<tx:method name="nver*" propagation="NEVER" />
			<tx:method name="supports*" propagation="SUPPORTS" />
			<tx:method name="notsupported*" propagation="NOT_SUPPORTED" />
			<tx:method name="*" />
		</tx:attributes>
	</tx:advice>

2:用注解的方式可以生效,不知道是不是spring版本的问题。


3:附上我使用的版本,希望大家遇到这个spring这个3.2.0版本如果read uncommitted不起作用,就用注解的方式,就可以生效了

Manifest-Version: 1.0
Created-By: 1.7.0_05 (Oracle Corporation)
Implementation-Title: spring-core
Implementation-Version: 3.2.0.RELEASE


Manifest-Version: 1.0
Created-By: 1.7.0_05 (Oracle Corporation)
Implementation-Title: spring-tx
Implementation-Version: 3.2.0.RELEASE


4:上面这个问题坑了我2天,被项目经理说了2周,就是说我这个查询老是报锁获取异常,实际就是read uncommitted不起作用。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值