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

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

包括这两种:

第一种: 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. 2014.3.11-C语言学习小结

    文件操作: 知识点: 持久化 1.文本文件的读写 2.二进制文件的读写 3.缓冲文件系统 1.打开文件 2.读写文件 3.保存 4.关闭文件 ============================= ...

  2. SZU:B85 Alec's Eggs

    Description Eggs Alec has a lot of eggs. One day, he want to sort them in a ascending sequence by we ...

  3. c++ virtual function 虚函数面试题

    下面的代码输出什么? #include<iostream> using namespace std; class A { public: virtual void foo() { cout ...

  4. ASP.NET MVC3开发 - CodeFisrt数据库篇之M层验证之调用远程方法(Remote)验证

    本文讲述在作者在使用.net mvc3进行开发的时候用到的两种调用远程验证的方法,第一种方法比较傻瓜,第二种方法方便好用,调用远程验证是个比较常见的验证方法,比如注册用户时的用户名唯一性验证. 作者原 ...

  5. java中除去字符串(String)中的换行字符(\r \n)

    有时在文本框中输入内容特别是粘贴内容时会出现一些换行符(\r\n),如下,在做字数验证或保存到数据库中时应过滤掉. str.replaceAll("\r|\n","&qu ...

  6. cocos2d-x 3.0 cocos run Couldn't find the gcc toolchain.

    出现这个错误是NDK_ROOT环境变量没有设置好,要么设置错了,要么没有重启终端(也就是环境变量还没有生效).我就是因为没有重启终端坑了一个晚上,我只能帮你到这了,玩cocos2d-x 3.0的朋友, ...

  7. 百度地图在某架构下找不到符号.a文件的问题

    1.现象: 就是说找不到符号给i386的架构(就是模拟器).或者找不到符号给arm架构(真机). ld: warning: ignoring file /Users/pufang/xcode/demo ...

  8. AJAX实现无刷新验证用户名

    register.php <html> <head> <meta http-equiv="content-type" content="te ...

  9. HTTP/1.1协议(中文归纳版)

    一.介绍(introduction) 1. 目的——HTTP/0.9-〉HTTP/1.0-〉HTTP/1.1 2. 要求——MUST.REQUIRED.SHOULD 3. 术语——连接(Connect ...

  10. github 自学文档 希望可以给初学的人一些帮助

    一 .git的安装 windows下面的安装:https://git-for-windows.github.io  从这里下载完全无脑安装. 安装完成后,在开始菜单里找到"Git" ...