zoukankan      html  css  js  c++  java
  • Write operations are not allowed in read-only mode (FlushMode.NEVER/MANUAL): Turn your Session into FlushMode.COMMIT/AUTO or remove 'readOnl

    org.springframework.dao.InvalidDataAccessApiUsageException: Write operations are not allowed in read-only mode (FlushMode.NEVER/MANUAL): Turn your Session into FlushMode.COMMIT/AUTO or remove 'readOnly' marker from transaction definition.

    错误解决办法:

     <filter-name>OpenSessionInViewFilter</filter-name>
       <filter-class>
        org.springframework.orm.hibernate3.support.OpenSessionInViewFilter
       </filter-class>
       <init-param>
        <param-name>sessionFactoryBeanName</param-name>
        <param-value>sessionFactory</param-value>
       </init-param>
       <init-param>
                <param-name>singleSession</param-name>
                <param-value>true</param-value>           
            </init-param>
            <init-param>
            <param-name> flushMode </param-name>
       <param-value>AUTO </param-value>        
            </init-param>
    </filter>

  • 相关阅读:
    调用百度地图API添加点聚合时,marker标注的label标签刷新丢失问题
    redis--基本命令
    centos8安装redis6.0.5
    centos8更改镜像源
    centos8重启网络服务
    搭建eureka高可用
    html5图片缩放后上传blob
    mysql主从复制
    zTree
    datetimepicker使用总结
  • 原文地址:https://www.cnblogs.com/oymx/p/3946292.html
Copyright © 2011-2022 走看看