zoukankan      html  css  js  c++  java
  • spring事物配置注意事项

     <tx:advice id="txAdvice" transaction-manager="transactionManager">
      <tx:attributes>
       <tx:method name="sav*" propagation="REQUIRED" rollback-for="Exception"/>
       <tx:method name="del*" propagation="REQUIRED" rollback-for="Exception"/>
       <tx:method name="updat*" propagation="REQUIRED" rollback-for="Exception"/><!-- rollback-for回滚事物,果存在一个事务,则支持当前事务。如果没有事务则开启  -->
       <tx:method name="qry*" propagation="NOT_SUPPORTED" read-only="true" />
        <tx:method name="*" propagation="NOT_SUPPORTED" read-only="true" /> <!--必须要加propagation否则存在事物依然执行,NOT_SUPPORTED总是非事务地执行,并挂起任何存在的事务-->
      </tx:attributes> 
     </tx:advice>
     <!-- 事物切入 -->
     
     <aop:config>
      <aop:pointcut id="cut"
       expression="execution(* com.jb.pub.dao.impl.*.*(..))" />
      <aop:advisor advice-ref="txAdvice" pointcut-ref="cut" />
     </aop:config>

  • 相关阅读:
    DDD领域驱动设计的理解
    设计原则
    毫秒级的时间处理图片
    同步设施
    ASP.NET Core 中文文档
    Jenkins快速搭建持续集成
    刮刮卡
    网页WEB打印控件
    nginx+memcached+ftp上传图片+iis
    通过Jexus 部署 dotnetcore
  • 原文地址:https://www.cnblogs.com/qgc88/p/3303075.html
Copyright © 2011-2022 走看看