Write operations are not allowed in read-only mode (FlushMode.MANUAL)错误的解决方法
来源:互联网 发布:用友仓库软件 编辑:程序博客网 时间:2024/05/20 06:08
异常: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.
直到DaoIpml.java 都是正确的,
DaoIpml.java中的源码
@Override
public void addSourceIndustry(SourceIndustry sourceIndustry) {
this.getHibernateTemplate().saveOrUpdate(sourceIndustry);
}
public void addSourceIndustry(SourceIndustry sourceIndustry) {
this.getHibernateTemplate().saveOrUpdate(sourceIndustry);
}
在使用save()方法 保存数据时,一直无法保存。
火狐浏览器报错:
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.
解决方法:
将createAdmin方法配置到spring的事件中管理,添加了以下的一条配置
<tx:method name="create*" propagation="REQUIRED"/>
具体spring事件配置如下:
<aop:config>
<aop:pointcut id="txServices"
expression="execution(* com.trig.service..*.*(..))" />
<aop:advisor advice-ref="txAdvice" pointcut-ref="txServices" />
</aop:config>
<tx:advice id="txAdvice" transaction-manager="transactionManager">
<tx:attributes>
<tx:method name="add*" propagation="REQUIRED" />
<tx:method name="insert*" propagation="REQUIRED" />
<tx:method name="update*" propagation="REQUIRED" />
<tx:method name="delete*" propagation="REQUIRED" />
<tx:method name="create*" propagation="REQUIRED" />
</tx:attributes>
</tx:advice>
0 0
- Write operations are not allowed in read-only mode (FlushMode.MANUAL)错误的解决方法
- Write operations are not allowed in read-only mode (FlushMode.MANUAL): 解决方法
- Write operations are not allowed in read-only mode (FlushMode.NEVER/MANUAL)异常解决方法
- 错误:Write operations are not allowed in read-only mode (FlushMode.NEVER/MANUAL)
- 错误:Write operations are not allowed in read-only mode (FlushMode.NEVER/MANUAL)..
- 错误:Write operations are not allowed in read-only mode (FlushMode.NEVER/MANUAL)..
- 错误:Write operations are not allowed in read-only mode (FlushMode.MANUAL)
- Write operations are not allowed in read-only mode (FlushMode.MANUAL)错误解决
- 解决Spring4+Hibernate4遇到的 Write operations are not allowed in read-only mode (FlushMode.MANUAL)
- ssh整合的时候出现错误:Write operations are not allowed in read-only mode (FlushMode.NEVER/MANUAL)
- open Session in view出现错误的解决方法Write operations are not allowed in read-only mode (FlushMode.NEVER) -
- Write operations are not allowed in read-only mode (FlushMode.NEVER/MANUAL): Turn your Session into
- Write operations are not allowed in read-only mode (FlushMode.MANUAL): Turn your Session into FlushM
- Hibernate Write operations are not allowed in read-only mode (FlushMode.MANUAL)
- Write operations are not allowed in read-only mode (FlushMode.NEVER/MANUAL): Turn your Session into
- Write operations are not allowed in read-only mode (FlushMode.NEVER/MANUAL)..
- Write operations are not allowed in read-only mode (FlushMode.NEVER/MANUAL)
- Write operations are not allowed in read-only mode (FlushMode.NEVER/MANUAL): Turn your Session into
- linux开发中的Segmentation fault的解析
- 倒不出的那种美妙--机房合作总结
- 4 Ways to Copy File in Java
- 特殊的九九乘法口表
- 学习windows phone 开发第一天
- Write operations are not allowed in read-only mode (FlushMode.MANUAL)错误的解决方法
- Myeclipse中如何快捷键生成setter和getter方法?
- 不知道函数调用关系时,处理思路
- 【问题收录】ImportError No module named MySQLdb 问题解决
- First Blog
- 【C语言】实现一个基于命令行的文本编辑器
- 元素大小
- Hadoop 数据压缩
- iOS开发-小白进阶-什么是ARC(二)