zoukankan      html  css  js  c++  java
  • spring-mybatis 事物配置 execution表达式含义

    1、

        <!-- 扫描service包下所有使用注解的类型 -->
        <context:component-scan base-package="com.yongjun.edu.service" />
    
        <!-- 配置事务管理器 -->
        <bean id="transactionManager"
            class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
            <!-- 注入数据库连接池 -->
            <property name="dataSource" ref="dataSource" />
        </bean>
        <!--配置事务的通知:(事务的增强)-->
        <tx:advice id="txAdvice" transaction-manager="transactionManager">
            <tx:attributes>
                <!--
                    propagation     :事务传播行为
                    isolation       :事务的隔离级别
                    read-only       :只读
                    rollback-for    :发生哪些异常回滚
                    no-rollback-for :发生哪些异常不回滚
                    timeout         :过期信息
                -->
                <tx:method name="store*" propagation="REQUIRED" read-only="false"/>
                <tx:method name="delete*" propagation="REQUIRED" read-only="false"/>
                <tx:method name="add*" propagation="REQUIRED" read-only="false"/>
                <tx:method name="save*" propagation="REQUIRED" read-only="false"/>
                <tx:method name="update*" propagation="REQUIRED" read-only="false"/>
                <tx:method name="load*" propagation="REQUIRED" read-only="true"/>
                <tx:method name="get*" propagation="REQUIRED" read-only="true"/>
                <tx:method name="*" propagation="REQUIRED" read-only="true" rollback-for="Exception"/>
            </tx:attributes>
        </tx:advice>
    
        <!--配置切面-->
        <aop:config>
            <!--配置切入点-->
            <aop:pointcut id="doService" expression="execution(* com.yongjun.edu.service..*.*(..))"/>
            <!--配置切面-->
            <aop:advisor advice-ref="txAdvice" pointcut-ref="doService"/>
        </aop:config>
    execution(* com.yongjun.edu.service..*.*(..)) 含义如下:

    
    
  • 相关阅读:
    CS231n assignment3 Q1 Image Captioning with Vanilla RNNs
    使用tensorflow预测函数的参数值(a simple task)
    CS231n assignment2 Q5 TensorFlow on CIFAR-10
    CS231n assignment2 Q4 Convolutional Networks
    HDU 1561 The more, The Better
    HDU4003 Find Metal Mineral
    poj 1947 Rebuilding Roads
    2090 背包
    poj 2408 Apple Tree
    奔跑的xiaodao
  • 原文地址:https://www.cnblogs.com/xcggdd/p/9021385.html
Copyright © 2011-2022 走看看