<!-- 管理事务的对象 -->
<bean id="trainsactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource" ref="dataSource"></property>
<!--管理实务的策略 -->
<!-- 配置通知 -->
<tx:advice id="txAdvice" transaction-manager="transactionManager">
<!-- 拦截方法 -->
<tx:attributes>
<tx:method name="save*" propagation="REQUIRED"/>
<tx:method name="update*" propagation="REQUIRED"/>
<tx:method name="delete*" propagation="REQUIRED"/>
<tx:method name="insert*" propagation="REQUIRED"/>
<tx:method name="*" propagation="REQUIRED"/>
</tx:attributes>
</tx:advice>
<!-- 切面编程,拦截service层 -->
<aop:config>
<aop:advisor advice-ref="txAdvice" pointcut="execution(* com.li.service.*.*(..))"/>
</aop:config>
</bean>
慕无忌4230737
慕瓜9220888
Frank作家