事务控制

来源:互联网 发布:淘宝卖家刷单流程 编辑:程序博客网 时间:2024/06/04 19:04
<?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:context="http://www.springframework.org/schema/context"
 xmlns:aop="http://www.springframework.org/schema/aop"
 xmlns:tx="http://www.springframework.org/schema/tx"
 xsi:schemaLocation="
  http://www.springframework.org/schema/beans
     http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
     http://www.springframework.org/schema/context
     http://www.springframework.org/schema/context/spring-context-3.0.xsd
  http://www.springframework.org/schema/tx
  http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
     http://www.springframework.org/schema/aop
     http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
 ">
 <!-- 事务处理 -->
    <tx:advice id="dicpteAdvice" 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="load*" propagation="REQUIRED" read-only="true"/>
     <tx:method name="read*" propagation="REQUIRED" read-only="true"/>
     <tx:method name="save*" propagation="REQUIRED" />
     <tx:method name="update*" propagation="REQUIRED" />
     <tx:method name="delete*" propagation="REQUIRED" />
             <tx:method name="*" propagation="REQUIRED" read-only="true"/>
   </tx:attributes>
  </tx:advice>
 
  <aop:config>
   <aop:pointcut id="dicpteDaoOperation" expression="execution(* com.revenue.dic.pte.service.*.*(..))"/>
   <aop:advisor advice-ref="dicpteAdvice" pointcut-ref="dicpteDaoOperation" order="0"/>
  </aop:config>
  
</beans>
0 0