zoukankan      html  css  js  c++  java
  • 记一次Spring事务get方法里不能进行修改数据的操作

    <!–声明事务–>
    <bean id=”txManager”>
    <property name=”sessionFactory” ref=”sessionFactory” />
    </bean>
    <!– 创建通知–>
    <tx:advice id=”txAdvice” transaction-manager=”txManager”>
    <tx:attributes>
    <tx:method name=”get*” read-only=”true”/>
    <tx:method name=”has*” read-only=”true”/>
    <tx:method name=”add*” propagation=”REQUIRED” />
    <tx:method name=”alter*” propagation=”REQUIRED” />
    <tx:method name=”upd*” propagation=”REQUIRED” />
    <tx:method name=”del*” propagation=”REQUIRED” />
    <tx:method name=”exec*” propagation=”REQUIRED” />
    </tx:attributes>
    </tx:advice>
    <!– 切入接口所在的包 –>
    <aop:config>
    <aop:pointcut id=”serviceOperation” expression=”execution(public * org.bgi.*.service.*.*(..))” />
    <aop:advisor advice-ref=”txAdvice” pointcut-ref=”serviceOperation” />
    </aop:config>

    由于配置的get*  方法为read-only,所以不能进行修改操作。

  • 相关阅读:
    数据绘图工具之Matplotlib
    数据分析
    scrapy-redis 实现分布式爬虫
    存储库之MongoDB
    pycharm解释器链接如何pymongo
    爬虫之request相关请求
    爬虫基本原理
    Xadmin
    当网页失去焦点时改变网页的title值
    gulp基础使用及进阶
  • 原文地址:https://www.cnblogs.com/lvhouhou/p/14204293.html
Copyright © 2011-2022 走看看