| 123456789101112131415161718192021222324252627282930313233343536373839404142 |
- <?xml version="1.0" encoding="UTF-8"?>
- <beans xmlns="http://www.springframework.org/schema/beans"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tx="http://www.springframework.org/schema/tx"
- xmlns:aop="http://www.springframework.org/schema/aop"
- xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
- http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-4.3.xsd
- http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-4.3.xsd">
-
- <!-- 事务管理器 -->
- <bean id="transactionManager"
- class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
- <!-- 数据源在spring-dao.xml文件中配置的-->
- <property name="dataSource" ref="dataSource" />
- </bean>
-
- <tx:annotation-driven transaction-manager="transactionManager"/>
-
- <!-- 通知 -->
- <tx:advice id="txAdvice" transaction-manager="transactionManager">
- <tx:attributes>
- <!-- 传播行为 -->
- <tx:method name="save*" propagation="REQUIRED" />
- <tx:method name="insert*" propagation="REQUIRED" />
- <tx:method name="add*" propagation="REQUIRED" />
- <tx:method name="create*" propagation="REQUIRED" />
- <tx:method name="delete*" propagation="REQUIRED" />
- <tx:method name="update*" propagation="REQUIRED" />
- <tx:method name="find*" propagation="SUPPORTS" read-only="true" />
- <tx:method name="select*" propagation="SUPPORTS" read-only="true" />
- <tx:method name="get*" propagation="SUPPORTS" read-only="true" />
- </tx:attributes>
- </tx:advice>
-
- <!-- 切面 -->
- <aop:config>
- <aop:advisor advice-ref="txAdvice"
- pointcut="execution(* com.ncjt.ch.sm.service.*.*(..))" />
- <aop:advisor advice-ref="txAdvice"
- pointcut="execution(* com.ncjt.ch.eg.qrcode.service.*.*(..))" />
- </aop:config>
-
- </beans>
|