zoukankan      html  css  js  c++  java
  • Spring事务配置

    <!-- 配置事务管理器 -->
    <bean id="txManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
            <property name="dataSource" ref="dataSource"/>
    </bean>
     
    <!-- 配置事务管理advice -->
    <tx:advice id="txAdvice" transaction-manager="txManager">
      <tx:attributes>
      <tx:method name="get*" 	read-only="true" />
      <tx:method name="find*"     read-only="true" />
      <tx:method name="select*"  	read-only="true"/>
      <tx:method name="query*"  	read-only="true"/>
      <tx:method name="search*"  	read-only="true"/>
      <tx:method name="count*"  	read-only="true" />
      <tx:method name="*"  propagation="SUPPORTS"  rollback-for="java.lang.Exception"/>
      </tx:attributes>
    </tx:advice>
    

      

      

    <!-- 配置切入点切面 -->
    <aop:config>
            <aop:pointcut id="txPointcut" expression="(execution(* com.avcon.*.*.service..*.*(..))) or (execution(* com.avcon.*.*.controller..*.*(..)))" />
            <aop:advisor pointcut-ref="txPointcut" advice-ref="txAdvice" />
         <!-- 增强代码 -->
          <aop:aspect order="-2147483648" ref="dynamicDataSourceAop">
               <aop:around pointcut-ref="txPointcut" method="doAroundMethod"/>
               <!-- 
               <aop:after-returning method=""/>
               <aop:before method=""/>
               <aop:after-throwing method=""/>
               <aop:after method=""/>
               -->
            </aop:aspect>
    </aop:config>
    

      

      

  • 相关阅读:
    DoubleAnimation
    Android 图片浏览器 从原来位置放大至全屏显示
    类似qq的左滑菜单栏简单实现
    UITableView去掉section的header的粘性
    swift 闭包循环引用
    AFNetworking3.0使用
    IOS线程学习(一)
    CIImage实现滤镜效果
    UIImage学习
    可滑动的ExpandableListView
  • 原文地址:https://www.cnblogs.com/zhoucx66/p/8967921.html
Copyright © 2011-2022 走看看