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>
    

      

      

  • 相关阅读:
    基于CentOS构建企业镜像站
    Linux命令——set 和 unset
    Bash基础——命令替换
    Bash基础——内置命令
    Linux命令——logger
    Linux命令——pgrep
    Linux下制作静态库 & 动态库
    理解ld-linux.so.2
    Bash基础——printf
    【问题】man手册如何查看区分printf命令和printf函数
  • 原文地址:https://www.cnblogs.com/zhoucx66/p/8967921.html
Copyright © 2011-2022 走看看