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>

Write operations are not allowed in read-only mode (FlushMode.NEVER/MANUAL): Turn your Session into FlushMode.COMMIT/AUTO or remove 'readOnl

时间: 2024-10-12 22:30:45

Write operations are not allowed in read-only mode (FlushMode.NEVER/MANUAL): Turn your Session into FlushMode.COMMIT/AUTO or remove 'readOnl的相关文章

(详解)Write operations are not allowed in read-only mode (FlushMode.NEVER/MANUAL): Turn your Session

昨天发现以前正常的功能报错了,错误日志如下: 报错日志: Hibernate: select taxtypecon0_.ID as ID62_, taxtypecon0_.TAX_TYPE_NAME as TAX2_62_, taxtypecon0_.EXPRESSIONS as EXPRESSI3_62_, taxtypecon0_.CREATE_DATE as CREATE4_62_, taxtypecon0_.CREATED_BY as CREATED5_62_, taxtypecon0_

Write operations are not allowed in read-only mode (FlushMode.MANUAL): Turn your Session into FlushMode.COMMIT/AUTO or remove &#39;readOnly&#39; marker from transaction definition.

最近在配置 Structs, spring 和hibernate整合的问题: 开启OpenSessionInViewFilter来阻止延迟加载的错误的时候抛出了这个异常: org.springframework.dao.InvalidDataAccessApiUsageException错误 但是在我们开启OpenSessionInViewFilter这个过滤器的时候FlushMode就已经被默认设置为了MANUAL! 如果FlushMode是MANUAL或NEVEL,在操作过程中 hibern

spring整合之后运行报什么只读错误。Write operations are not allowed in read-only mode (FlushMode.MANUAL): Turn your Session into FlushMode.COMMIT/AUTO or remove &#39;readOnly&#39; marker from transaction definition.

解决办法, 再大dao的实现类上添加注解: @Transactional(readOnly = false ) 不让它只读就行了 spring整合之后运行报什么只读错误.Write operations are not allowed in read-only mode (FlushMode.MANUAL): Turn your Session into FlushMode.COMMIT/AUTO or remove 'readOnly' marker from transaction defi

Write operations are not allowed in read-only mode (FlushMode.MANUAL): Turn your Session into FlushM

错误提示:Write operations are not allowed in read-only mode (FlushMode.MANUAL): Turn your Session into FlushMode.COMMIT/AUTO or remove 'readOnly' marker from transaction definition. 我在删除一条数据时出现了以上错误,网上查询的答案基本是说这个错误一般由事务引起的,有可能是项目事务配置文件不正确,但是我删除其它数据并没有出现这

保存数据报错Write operations are not allowed in read-only mode (FlushMode.MANUAL)

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

hibernate框架学习错误集锦-org.springframework.dao.InvalidDataAccessApiUsageException: Write operations are not allowed in read-only mode (FlushMode.MANUAL)

最近学习ssh框架,总是出现这问题,后查证是没有开启事务. 如果采用注解方式,直接在业务层加@Transactional 并引入import org.springframework.transaction.annotation.Transactional; 详细信息,可以参考下面博客: 参考资料:http://blog.csdn.net/longxia1987/article/details/7819242 org.springframework.dao.InvalidDataAccessApi

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

今天在做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*就可以了. <!-- 配置事务策略

OpenSessionInViewFilter与org.springframework.dao.InvalidDataAccessApiUsageException

本文转载:Iuranus 报错: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 definit

spring3.* + hibernate3.* 整合常见问题总结

1.为了解决应用中的中文乱码问题,我们可以不用自己开发过滤器类,Spring为我们提供了一个,只需要配置一下即可: <!-- 解决乱码问题 --> <filter> <filter-name>CharacterFilter</filter-name> <filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class> <init-