增删改查 报异常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="transactionManager">
<tx:attributes>
<tx:method name="add*" propagation="REQUIRED" />
<tx:method name="delete*" propagation="REQUIRED" />
<tx:method name="save*" propagation="REQUIRED" />
<tx:method name="upData*" propagation="REQUIRED" />
<tx:method name="*" read-only="true" />
</tx:attributes>
</tx:advice>
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 defini
增删改查 报异常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的更多相关文章
- org.springframework.dao.InvalidDataAccessApiUsageException: Write operations are not allowed in read-only mode
[spring]:org.springframework.dao.InvalidDataAccessApiUsageException: Write operations are not allowe ...
- hibernate框架学习错误集锦-org.springframework.dao.InvalidDataAccessApiUsageException: Write operations are not allowed in read-only mode (FlushMode.MANUAL)
最近学习ssh框架,总是出现这问题,后查证是没有开启事务. 如果采用注解方式,直接在业务层加@Transactional 并引入import org.springframework.transacti ...
- 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 ) 不让它只读就行了
- 报错:org.springframework.dao.InvalidDataAccessApiUsageException: Executing an update/delete query; nested exception is javax.persistence.TransactionRequiredException: Executing an update/delete query
service实现类上没有加@transaction 事务注解
- OpenSessionInViewFilter与org.springframework.dao.InvalidDataAccessApiUsageException
报错:org.springframework.dao.InvalidDataAccessApiUsageException: Write operations are not allowed in r ...
- javaEE-----org.springframework.dao.InvalidDataAccessApiUsageException: Write operation
org.springframework.dao.InvalidDataAccessApiUsageException: Write operations are not allowed in read ...
- org.springframework.dao.InvalidDataAccessApiUsageException
org.springframework.dao.InvalidDataAccessApiUsageException: Write operations are not allowed in read ...
- javaweb连接数据库并完成增删改查
一.连接数据库 1.mysql数据库的安装和配置 在网上找到了篇关于mysql的安装详细说明,供读者自己学习 https://www.jb51.net/article/23876.htm 2.mysq ...
- Android下利用SQLite数据库实现增删改查
1: 首先介绍如何利用adb查看数据库 1: adb shell 2: cd /data/data/包名/databases 3: sqlite3 数据库 4 接下来就可以进行数据库的sql语法 ...
随机推荐
- java实例初始化块
实例初始化程序块用于初始化实例数据成员. 它在每次创建类的对象时运行.实例变量的初始化可以是直接的,但是可以在初始化实例初始化块中的实例变量时执行额外的操作. 什么是实例初始化块的使用,我们可以直接分 ...
- -ms-zoom property
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...
- vue——介绍和使用
一.vue介绍 vue官网说:Vue.js(读音 /vjuː/,类似于 view) 是一套构建用户界面的渐进式的JavaScript框架.与其他重量级框架不同的是,Vue 采用自底向上增量开发的设计. ...
- MongoDB学习之mongoose
MongoDB介绍: MongoDB是基于Javascript语言的数据库,存储格式是JSON,而Node也是基于JavaScript的环境(库),所以node和mongoDB的搭配能减少因为数据转换 ...
- requireJS基本配置相关
requireJS: (1)实现js文件的异步加载,避免页面失去响应: (2)管理模块之间的依赖性,便于代码的编写和维护. 加载: <script src="js/require.js ...
- scala之Duration
import scala.concurrent.duration._ val duration = Duration(100, MILLISECONDS) val duration = Duratio ...
- Python tqdm show progress bar
tqdm can help to show a smart progress bar, and it is very easy to use, just wrap any iterable with ...
- C语言实现一元多项式求积
#include <stdio.h>#include <stdlib.h>#include <math.h>typedef struct Node{ int ...
- python解析HTML之:PyQuery库的介绍与使用
本篇大部分转载于https://www.jianshu.com/p/c07f7cd1b548 先放自已自己解析techweb一个网站图片的代码 from pyquery import PyQuery ...
- hdu 6243,6247
题意:n只狗,n个笼子,每个笼子只能有一只,求不在自己笼子的狗的数量的期望. 分析:概率是相等的,可以直接用方案数代替,k 不在自己的笼子的方案数是 n!- (n-1)!,这样的k有n个,总的方案数n ...