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*就可以了。
<!-- 配置事务策略 -->
<tx:advice id="txAdvice" transaction-manager="myTxManager">
<tx:attributes>
<tx:method name="find*" propagation="REQUIRED" read-only="true" />
<tx:method name="save*" propagation="REQUIRED" />
<tx:method name="*" propagation="SUPPORTS" read-only="true" />
</tx:attributes>
</tx:advice>
Write operations are not allowed in read-only mode (FlushMode.NEVER/的更多相关文章
- Write operations are not allowed in read-only mode
使用Spring提供的Open Session In View而引起Write operations are not allowed in read-only mode (FlushMode.NEVE ...
- 解决Hibernate Write operations are not allowed in read-only mode的方法
错误信息: org.springframework.dao.InvalidDataAccessApiUsageException: Write operations are not allowed i ...
- Write operations are not allowed in read-only mode错误
(转+作者个人理解) 最近在配置 Structs, Spring 和Hibernate整合的问题: 开启OpenSessionInViewFilter来阻止延迟加载的错误的时候抛出了这个异常: org ...
- 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 ...
- 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 ...
- Write operations are not allowed in read-only mode 只读模式下(FlushMode.NEVER/MANUAL)写操作不允
org.springframework.dao.InvalidDataAccessApiUsageException: Write operations are not allowed in read ...
- 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 ...
- Write operations are not allowed in read-only mode 只读模式下(FlushMode.NEVER/MANUAL)写操作不
org.springframework.dao.InvalidDataAccessApiUsageException: Write operations are not allowed in read ...
随机推荐
- 【风马一族_mysql】MySQL免安装版环境配置图文教程
mysql存放在某一个磁盘中(笔者使用E盘) 配置系统变量 打开 电脑的属性 点击 高级系统设置 选择 高级 点击 环境变量 选择 系统变量 点击 变量Path,追加 值 E:\mysql-5.6.2 ...
- 常见的HTTP错误总结
一般来说HTTP2XX,代表请求正常完成,HTTP3XX代表网站重定向,HTTP4XX,代表客户端出现错误,HTTP5XX,代服务器端出现了错误 HTTP301:请求的数据具有新的位置 HTTP302 ...
- 多屏判断css改写
function replaceBodyClass(){ for(var i in map){ if(map[i](width)){ document.body.className = documen ...
- php输出函数 var_dump, dump,print,print_r 区别
php输出函数 var_dump, dump,print,print_r 区别 周末有空就来整理下
- JS 获取浏览器和屏幕宽高等信息代码
JS 获取浏览器和屏幕宽高等信息. 网页可见区域宽:document.body.clientWidth 网页可见区域高:document.body.clientHeight 网页可见区域宽:doc ...
- 百度搜索API v3版本与soap
技术文档请参考http://dev2.baidu.com/docs.do?product=2#page=File,和http://dev2.baidu.com/docs.do?product=2#pa ...
- C++读入一个参数
题目内容:已知正方形的边长,试编程求出其面积. 输入描述:输入不超过50个正整数的数据n(1<=n<=10000),每个正整数间以空格隔开. 输出描述:每次读入一个正整数,便输出其正方形的 ...
- JS调用腾讯接口获取天气
想做个直接通过JS获取某个城市的天气.本来想通过直接调用中国气象网的接口: http://www.weather.com.cn/weather/101070201.shtml,但是跨域问题一直无法解决 ...
- DevExpress汉化(WinForm)
/* *隔壁老王原创,2013-09-21,转载请保留本人信息及本文地址. *本文地址:http://wallimn.iteye.com/blog/1944191 */ 最简单的方式就是使用汉化资源, ...
- Oracle获取表结构信息:表名、是否视图、字段名、类型、长度、非空、主键
select a.TABLE_NAME as "TableName", then 'V' else 'U'end as "TableType", a.COLUM ...