zoukankan      html  css  js  c++  java
  • Spring xml中的tx:advice标签

    官方文档:

    The concept of "advisors" is brought forward from the AOP support defined in Spring and does not have a direct equivalent in AspectJ. An advisor is like a small self-contained aspect that has a single piece of advice. The advice itself is represented by a bean, and must implement one of the advice interfaces described in Advice types in Spring. Advisors can take advantage of AspectJ pointcut expressions though.

    Spring supports the advisor concept with the <aop:advisor> element. You will most commonly see it used in conjunction with transactional advice, which also has its own namespace support in Spring. Here’s how it looks:

    简言之:advisors的概念来至于Spring aop,但是advisor在aspectj中并没有用一个等价概念。advisor类似一个切面。

        <aop:config>
            <aop:advisor id="tx-advisor" advice-ref="tx-advice"
                         pointcut="execution(public * com.javartisan.sf.*.*(*))"/>
        </aop:config>
    
        <tx:advice id="tx-advice" transaction-manager="transactionManager">
            <tx:attributes>
                <tx:method name="save*" propagation="REQUIRED" timeout="20000" isolation="READ_COMMITTED"
                           rollback-for="java.lang.RuntimeException" no-rollback-for="com.javartisan.CustomException"
                           read-only="false"/>
                <tx:method name="del*" propagation="REQUIRED" timeout="20000" isolation="READ_COMMITTED"
                           rollback-for="java.lang.RuntimeException" no-rollback-for="com.javartisan.CustomException"
                           read-only="false"/>
            </tx:attributes>
        </tx:advice>
      
    

      

  • 相关阅读:
    .NET Framework Execution Was Aborted By Escalation Policy
    语句获取作业属性、历史记录
    Login failed知多少
    数据库代理错误日志
    微信小程序资料
    时间进度条,根据时间,显示任务进度条
    两个select 左右添加,上下移动
    图片轮播无缝接
    CSS3简单的栅格系统
    JavaScript DOM节点和文档类型
  • 原文地址:https://www.cnblogs.com/leodaxin/p/12216833.html
Copyright © 2011-2022 走看看