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>
      
    

      

  • 相关阅读:
    原创:ESXi5.1安装实验1
    Xeon 5000系列说起
    ESXi5.1安装实验3
    VMware虚拟化网络和存储功能简介
    Understanding Core Exchange Server 2007 Design Plans
    Exchange 2007和2003,2000等共存。
    自动发现服务深入理解
    管理 POP3 和 IMAP4 服务
    原创:vsphere client 5.1安装实战
    UPNP解读2含netbios,wins,DNS
  • 原文地址:https://www.cnblogs.com/leodaxin/p/12216833.html
Copyright © 2011-2022 走看看