<!--transaction config start-->
<!--声明式事物配置-->
<!--配置事物管理ibatis,Hibernate使用HibernateTransactionManager-->
<bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource" ref="dataSource_eactivity"/>
</bean>
<!-- 配置事务传播特性 -->
<tx:advice id="TestAdvice" transaction-manager="transactionManager">
<tx:attributes>
<tx:method name="save*" propagation="REQUIRED"/>
<tx:method name="update*" propagation="REQUIRED"/>
<tx:method name="*" propagation="REQUIRED" rollback-for="RuntimeException"/>
</tx:attributes>
</tx:advice>
<!-- 配置参与事务的类 ,切面配置-->
<aop:config>
<aop:pointcut id="allTestServiceMethod"
expression="execution(* com.web.yx.service.*.*(..))"/>
<aop:advisor pointcut-ref="allTestServiceMethod" advice-ref="TestAdvice" />
</aop:config>
<!--声明式事物配置-->
<!--配置事物管理ibatis,Hibernate使用HibernateTransactionManager-->
<bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource" ref="dataSource_eactivity"/>
</bean>
<!-- 配置事务传播特性 -->
<tx:advice id="TestAdvice" transaction-manager="transactionManager">
<tx:attributes>
<tx:method name="save*" propagation="REQUIRED"/>
<tx:method name="update*" propagation="REQUIRED"/>
<tx:method name="*" propagation="REQUIRED" rollback-for="RuntimeException"/>
</tx:attributes>
</tx:advice>
<!-- 配置参与事务的类 ,切面配置-->
<aop:config>
<aop:pointcut id="allTestServiceMethod"
expression="execution(* com.web.yx.service.*.*(..))"/>
<aop:advisor pointcut-ref="allTestServiceMethod" advice-ref="TestAdvice" />
</aop:config>