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 ...
随机推荐
- 打包新版本上传到AppStore时报错 ERROR ITMS-90034:
今天打包新版本上传到AppStore时报错 ERROR ITMS-90034:"Missing or invalid signature.The bundle'com.xxx.xxx' at ...
- UML类图常见关系总结
Unified Modeling Language (UML)又称统一建模语言或标准建模语言. 在UML类图中,常见的有以下几种关系: 泛化(Generalization), 实现(Realizat ...
- SMTP sendMail 失败解决办法
If you are seeing messages like this in your message log when running a process through the process ...
- Kettle 合并记录报错!
在Kettle的合并记录过程的时候,在“为了转换解除补丁开始 ”这一步的时候报错.具体错误如图所示: Kettle的转换如图所示: 问题原因:可能是你的数据库链接驱动和Kettle的版本不兼容. 解决 ...
- PHP数组在HTML之中的应用
<select name="data[status]" id="" <?php if(in_array($list['status'],array( ...
- PHP 把GBK编码转换为UTF8
//把GBK编码转换为UTF8 $name="勿以善小而不为"; $name=iconv("GBK", "UTF-8", $name);
- WIN7 shutdown 定时/倒计时 命令关机
解决方案: 一.可以通过DOS命令shutdown来解决 在 Win7 中,shutdown实现自动关机的方法如下: 开始->运行->cmd 运行"shutdown -s -t ...
- 【转载】Android通过ksoap2调用.net(c#)的webservice
转载自:http://www.cnblogs.com/badtree/articles/3242842.html ■下载 ksoap2-android 包 去http://code.google.co ...
- windows下文件名非法字符
/ \ : * ? " < > | / \如果用作文件名,会产生路径问题.因为绝对路径用 \ ; 相对路径用 / ;
- STM32F0xx_DAC输出电压配置详细过程
前言 数模转换DAC的功能在现实应用中所占的分量,相对定时器TIM.串口USART等要小的多,这也是ST为什么内部集成DAC模块相对来说不是那么多的原因.但在有需要使用数模转换功能的项目中,自带的这个 ...