• spring aop xml事务配置


    <aop:config>  
        <!-- 通过aop定义事务增强切面-->
            <aop:pointcut id="serviceMethod"     expression="execution(* cc.zeelan.app.service..*.*(..))" />  
      <!--事务增强-->  
            <aop:advisor pointcut-ref="serviceMethod" advice-ref="txAdvice" />  
        </aop:config>   
        
      <!--事务增强 -->  
        <tx:advice id="txAdvice" transaction-manager="transactionManager">  
           <!-- 事务属性定义 -->  
           <tx:attributes>   
            <!--  读取事务  -->  
               <tx:method name="query*" propagation="SUPPORTS" read-only="true" timeout="600"/>  
               <tx:method name="find*" propagation="SUPPORTS"  read-only="true"   timeout="600"/> 
               <tx:method name="get*" propagation="SUPPORTS"  read-only="true"   timeout="600"/> 
               <tx:method name="select*" propagation="SUPPORTS"  read-only="true"   timeout="600"/> 
               <tx:method name="sum*" propagation="SUPPORTS"  read-only="true"   timeout="600"/> 
               
               <!-- 操作事务  -->  
               <tx:method name="add*"   propagation="REQUIRED" read-only="false" rollback-for="Exception"/>  
           <tx:method name="inse*"   propagation="REQUIRED" read-only="false" rollback-for="Exception"/>  
               <tx:method name="del*"  propagation="REQUIRED" read-only="false"  rollback-for="Exception"/>  
               <tx:method name="update*"  propagation="REQUIRED" read-only="false"  rollback-for="Exception"/>
               <tx:method name="edit*"  propagation="REQUIRED" read-only="false"  rollback-for="Exception"/>
                <tx:method name="task*"  propagation="REQUIRED" read-only="false"  rollback-for="Exception"/>
           </tx:attributes>  
        </tx:advice>     
  • 相关阅读:
    UVALive 6909 Kevin's Problem 数学排列组合
    UVALive 6908 Electric Bike dp
    UVALive 6907 Body Building tarjan
    UVALive 6906 Cluster Analysis 并查集
    八月微博
    hdu 5784 How Many Triangles 计算几何,平面有多少个锐角三角形
    hdu 5792 World is Exploding 树状数组
    hdu 5791 Two dp
    hdu 5787 K-wolf Number 数位dp
    hdu 5783 Divide the Sequence 贪心
  • 原文地址:https://www.cnblogs.com/light-zhang/p/8350034.html
Copyright © 2020-2023  润新知