rollback-for="Exception" />
rollback-for="Exception" />
rollback-for="Exception" />
rollback-for="Exception" />
timeout="36000" />
timeout="36000" />
timeout="36000" />
timeout="36000" />
expression="execution( com.abc..Service.*(..))" />
单个数据源我一般这么配置,如果是多个数据源,怎么配置,spring3支持 @Transactional 配置多个数据源,不知道使用xml怎么配置,我主要是想使用 aop的expression 这样拦截包比较方便
spring 3 怎么配置多个数据源事务?
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。
<property name="dataSource" ref="dataSource1" />
<property name="dataSource" ref="dataSource2" />
<tx:attributes>
<tx:method name="get*" propagation="NOT_SUPPORTED" />
<tx:method name="save*" propagation="REQUIRED" rollback-for="Exception"/>
<tx:method name="del*" propagation="REQUIRED" rollback-for="Exception" />
<!-- ... -->
</tx:attributes>
<tx:attributes>
<tx:method name="get*" propagation="NOT_SUPPORTED" />
<tx:method name="save*" propagation="REQUIRED" rollback-for="Exception"/>
<tx:method name="del*" propagation="REQUIRED" rollback-for="Exception" />
<!-- ... -->
</tx:attributes>
<aop:pointcut id="transcationPointcut1" expression="execution(* com.test1.service.impl.*.*(..))"/>
<aop:pointcut id="transcationPointcu2t" expression="execution(* com.test2.service.impl.*.*(..))"/>
<aop:advisor pointcut-ref="transcationPointcut1" advice-ref="txAdvice1" />
<aop:advisor pointcut-ref="transcationPointcut2" advice-ref="txAdvice2" />