zoukankan      html  css  js  c++  java
  • 事务的切入和排除

    前些天遇到事务需要排除的情况,直接贴出来~~

     1     <!-- 事务配置 -->
     2     <tx:advice id="txAdvice" transaction-manager="txManager" >
     3         <tx:attributes>
     4             <tx:method name="select*"        propagation="NOT_SUPPORTED" rollback-for="java.lang.Throwable"/>
     5             <tx:method name="get*"            propagation="NOT_SUPPORTED" rollback-for="java.lang.Throwable"/>
     6             <tx:method name="query*"        propagation="NOT_SUPPORTED" rollback-for="java.lang.Throwable"/>
     7             <tx:method name="*"                propagation="REQUIRED" rollback-for="java.lang.Throwable"/>
     8         </tx:attributes>
     9     </tx:advice>
    10     <aop:config><!-- 事务切入和事务排除 -->
    11         <aop:pointcut id="allManagerMethod" expression="execution(* com.aria.service..*.*(..)) and not execution(* com.aria.service.test..*.*(..))"/>
    12         <aop:advisor advice-ref="txAdvice" pointcut-ref="allManagerMethod" />
    13     </aop:config>
    14     <bean id="txManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
    15         <property name="dataSource" ref="dataSource" />
    16     </bean>
    17     <!-- 事务配置 end  -->
    View Code
  • 相关阅读:
    bzoj1731 [Usaco2005 dec]Layout 排队布局
    loj10087 Intervals
    差分约束小结
    bzoj1112 [POI2008]砖块Klo
    bzoj3524 [POI2014]Couriers
    poj2752 Seek the Name, Seek the Fame
    1027C Minimum Value Rectangle
    bzoj2212 [POI2011]Tree Rotations
    bzoj3747 [POI2015]Kinoman
    628D Magic Numbers
  • 原文地址:https://www.cnblogs.com/modairy/p/7993784.html
Copyright © 2011-2022 走看看