您的位置:首页 > 运维架构

Write operations are not allowed in read-only mode (FlushMode.MANUAL)

2014-06-17 13:23 417 查看
Hibernate使用过程中出现此类错误:Write operations are not allowed in read-only mode (FlushMode.MANUAL)

解决办法:

检查你的事务配置中的方法前缀是否和你现在使用的方法前缀一致,如果一致,需要修改你使用的方法前缀。

例如:

事务配置:

        <tx:attributes>

            <tx:method name="insert*" rollback-for="Exception" />

            <tx:method name="update*" rollback-for="Exception" />

            <tx:method name="delete*" rollback-for="Exception" />

            <tx:method name="get*" read-only="true" />

            <tx:method name="*" />

        </tx:attributes>


方法:getProductPackId 建议修改前缀xxxProductPackId 主要是看你的事务配置哪一层了
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐