zoukankan      html  css  js  c++  java
  • spring事物

     <!-- 配置事务异常封装 -->
       <bean id="persistenceExceptionTranslationPostProcessor" 
           class="org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor" />
       
       <!--  声明式容器事务管理 ,transaction-manager指定事务管理器为transactionManager -->
        <tx:advice id="txAdvice" transaction-manager="transactionManager">
            <tx:attributes>
                <tx:method name="add*" propagation="REQUIRED" />
                <tx:method name="get*" propagation="REQUIRED" />
                <tx:method name="*" read-only="true" />
            </tx:attributes>
        </tx:advice>
        
        <aop:config expose-proxy="true">
            <!-- 只对业务逻辑层实施事务 -->
            <aop:pointcut id="txPointcut" expression="execution(* com.lei.demo.service..*.*(..))" />
            <!-- Advisor定义,切入点和通知分别为txPointcut、txAdvice -->
            <aop:advisor pointcut-ref="txPointcut" advice-ref="txAdvice"/>
        </aop:config>
  • 相关阅读:
    JS中常遇到的浏览器兼容问题和解决方法
    遍历
    深度克隆和浅拷贝
    js数据类型
    js运算符
    理解js中的事件模型
    常见事件总结
    模板方法模式
    适配器模式和外观模式
    命令模式
  • 原文地址:https://www.cnblogs.com/javaweb2/p/6594258.html
Copyright © 2011-2022 走看看