这个错误我整理了  半天才发现问题的存在。

尝试了网上的很多办法,但是最后都没有达到效果。

包括这两种:

第一种: web.xml种的配置

<filter>
<filter-name>OpenSessionInViewFilter</filter-name>
<filter-class>org.springframework.orm.hibernate5.support.OpenSessionInViewFilter</filter-class>
<init-param>
<param-name>flushMode</param-name>
<param-value>AUTO</param-value>
</init-param>
</filter>

<filter-mapping>
<filter-name>OpenSessionInViewFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>

第二种是  修改readonly

如果两种方式都不行的话,请试试这种方式

检查你的事务管理设置。我的注释中的是正确的。

<!-- <aop:pointcut expression="execution(* com.cqut.computer.wang.future_mail.dao.*.*(..))"
id="txMethods" />
<aop:pointcut expression="execution(* com.cqut.computer.wang.future_mail.service.*.*(..))"
id="txMethods" /> -->
<aop:pointcut expression="execution(* com.**.dao.*.*(..))"
id="txMethods" />
<aop:pointcut expression="execution(* com.**.service.*.*(..))"
id="txMethods" />

ssh中的 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.的更多相关文章

  1. 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.

    Struts Problem Report Struts has detected an unhandled exception: Messages: Write operations are not ...

  2. 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 definition.

    1.异常分析 Write operations are not allowed in read-only mode (FlushMode.MANUAL): Turn your Session into ...

  3. HTTP Status 500 - 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.

    如果在service类上面没有添加注解,出现异常 @Transactional

  4. 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 definition.

    解决办法, 再大dao的实现类上添加注解: @Transactional(readOnly = false ) 不让它只读就行了

  5. 增删改查 报异常org.springframework.dao.InvalidDataAccessApiUsageException: Write operations are not allowed in read-only mode (FlushMode.MANUAL): Turn your Session into FlushMode.COMMIT/AUTO or remove 'readO

    可能是Spring配置文件 事务通知里面的方法  与实际方法不匹配 <tx:advice id="advice" transaction-manager="tran ...

  6. ssh整合思想 Spring分模块开发 crud参数传递 解决HTTP Status 500 - Write operations are not allowed in read-only mode (FlushMode.MANUAL): Turn your Session into FlushMode.COMMIT/AUTO or(增加事务)

    在Spring核心配置文件中没有增加事务方法,导致以上问题 Action类UserAction package com.swift.action; import com.opensymphony.xw ...

  7. 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 ...

  8. SSH中使用延迟加载报错Exception occurred during processing request: could not initialize proxy - no Session

    17:40:17,249 ERROR DefaultDispatcherErrorHandler:42 - Exception occurred during processing request: ...

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

    这个异常我在网上查看了很多资料,一般都说是hibernate的session问题,让重新两个方法,但是我以前用的时候没问题啊,所以一直找问题,终于这个bug让我找到了,就是因为我插入操作的时候用的是别 ...

随机推荐

  1. Effective C++(11) 自我赋值(a=a)时会发生什么?

    问题聚焦: 自我赋值看似有点愚蠢的行为,其实总会发生的 首先:它是合法的, 其次,它不一定是安全的, 再次,它有时候不是那么明显. 先看一个Demo class Widget { ... }; Wid ...

  2. linux extract rar files

    Extract rar-archives If you need to extract rar files in Linux, you have to download and install unr ...

  3. vs2012+Spring.Core.dll

    Ⅰ.Spring的点点滴滴--序章   spring是一个轻量级的控制反转(IoC)和面向切面(AOP)的容器框架 .net篇(环境为vs2012+Spring.Core.dll) 新建一个控制台 u ...

  4. vector如何进行局部排序

    对于vector的全体排序,我们知道sort(vv.begin(),vv.end())来进行的. 但是对于如果是局部排序的话,比如,vector有100个元素,但我只想对10-80之间的数进行排序,如 ...

  5. .NET面向对象特性之“继承”

    整体简介 1.理解继承——继承关系图 2.实现继承与接口多继承 3.new. virtual.override方法 4.抽象方法和抽象类的继承 5.继承的本质 6.继承的复用性.扩展性和安全性 7.多 ...

  6. VS2003与Win7的兼容性问题

    VS2003并不官方支持Win7,目前大家遇到的主要是两个问题: 1. 在debug的时候,*.pdb文件在会被devenv.exe给lock住,当调适过一次之后,再进行编译的时候会有lnk1201的 ...

  7. Atomic变量和Thread局部变量

    Atomic变量和Thread局部变量 前面我们已经讲过如何让对象具有Thread安全性,让它们能够在同一时间在两个或以上的Thread中使用.Thread的安全性在多线程设计中非常重要,因为race ...

  8. jQuery焦点图切换特效插件封装

    网站焦点图是一种网站内容的展现形式,可简单理解为一张图片或多张图片展现在网页上就是网站焦点图.在网站很明显的位置,用图片组合播放的形式,类似焦点新闻的意思只不过加上了图片.一般多使用在网站首页版面或频 ...

  9. MySQL能够承受上亿万条的数据量的架构

    MySQL能够承受上亿万条的数据量的架构 最近做的搜索引擎的数据量是越来越大估计了下在中国可能涉及到的1Kw的数据量,就全球来说也就是1K亿而已,最初是用的数据库是MySQL现在来说要做些优化,最终使 ...

  10. oracle 11g使用deferred_segment_creation 延迟段创建特性时遇到的问题总结

    总结,下面是两个问题.问题1是用户可以在所有表空间创建表;问题2是exp不能导出空表 问题1: 版本:oracle 11.2.0.1.0 select * from v$version; 创建用户aa ...