首页 > 其他 > 详细

Write operations are not allowed in read-only mode (FlushMode.NEVER/

时间:2015-01-16 18:42:09      阅读:296      评论:0      收藏:0      [点我收藏+]

今天在做ssh项目开发的时候遇到一个问题,保存数据的时候报错:

Write operations are not allowed in read-only mode (FlushMode.NEVER/

后参考这篇文章才知道出了什么问题:http://www.aichengxu.com/view/37412

原来在Spring事务管理中save类的方法都没有read-only=true,但是我的方法是add*,所以就出现开头讲的问题,把add*方法改成save*就可以了。

<!-- 配置事务策略 -->
    <tx:advice id="txAdvice" transaction-manager="myTxManager">
        <tx:attributes>
            <tx:method name="find*" propagation="REQUIRED" read-only="true" />
            <tx:method name="save*" propagation="REQUIRED" />
            <tx:method name="*" propagation="SUPPORTS" read-only="true" />
        </tx:attributes>
    </tx:advice>

 

Write operations are not allowed in read-only mode (FlushMode.NEVER/

原文:http://www.cnblogs.com/zhangwei595806165/p/4229242.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!