Nhibernate Batch update returned unexpected row count from update; actual row count: 0 解决方案
以前在session.Update(object)。没发现啥问题,最近update的时候,老是报错:Nhibernate Batch update returned unexpected row count from update; actual row count: 0 ;后来发现这个是因为nhibernate一级缓存机制引起的,所以我们要这么做就没啥问题了。
session.Clear();
session.Update();
session.Flush();
这三个东西,session.Clear() 是把一级缓存里面的东西清除掉(保留session) session.Flush(让缓存和数据库当中做到一致)
Nhibernate Batch update returned unexpected row count from update; actual row count: 0 解决方案的更多相关文章
- org.hibernate.StaleStateException: Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1
org.hibernate.StaleStateException: Batch update returned unexpected row count from update [0]; actua ...
- 20.org.hibernate.StaleStateException: Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1
org.hibernate.StaleStateException: Batch update returned unexpected row count from update [0]; actua ...
- Batch update returned unexpected row count from update [0] 异常处理
在one-to-many时遇到此异常,本以为是配置出错.在使用s标签开启debug模式,并在struts2主配置文件中添加异常映射,再次提交表单后得到以下异常详情. org.springframewo ...
- 关于Hibernate级联更新插入信息时提示主键不为空的问题“org.hibernate.StaleStateException: Batch update returned unexpected row count from update: 0 actual row count: 0 expected: 1 ”
org.hibernate.StaleStateException: Batch update returned unexpected row count from update: 0 actual ...
- 关于Error during managed flush [Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1]错误
控制台报错: 08:07:09.293 [http-bio-8080-exec-2] ERROR org.hibernate.internal.SessionImpl - HHH000346: Err ...
- Batch update returned unexpected row count from update [0];
Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1; nested ...
- Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1
在操作hibernate数据库时,调用saveOrUpdate方法进行更新保存对象时, (1)ID为null时执行SAVE,但是前端jsp通过<input type="hidden&q ...
- 错误Batch update returned unexpected row count from update [0]; actual row count: 0;
参考:http://blog.csdn.net/ssyan/article/details/7471343 也是出现类似问题,在前台页面的隐藏域中判断id是否为null,而没有去判断是否为空字符串. ...
- hibernate 解决 org.hibernate.StaleStateException: Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1
这是因为没有设置要更新的主键导致的,只要设置了要更新的主键就能更新成功(没有主键当然不能更新)
随机推荐
- BAT经典面试题之redis的热KEY问题怎么解决
引言 讲了几天的数据库系列的文章,大家一定看烦了,其实还没讲完...(以下省略一万字).今天我们换换口味,来写redis方面的内容,谈谈热key问题如何解决.其实热key问题说来也很简单,就是瞬间有几 ...
- 字的研究(2)Fonttools-字体文件的解析
前言 本文主要介绍如果使用Python第三方库fontTools对TrueType字体文件(指使用TrueType描述轮廓的OpenType字体文件)的解析.修改和创建等操作. fontTools简介 ...
- Python 单元测试 生产HTML测试报告
使用HTMLTestRunnerNew模块,生成单元测试的html报告,报告标题根据对应测试时间. import unittest from datetime import datetime from ...
- plsql 储存过程 参数的传递方式?
/* 存储过程 一.oracel存储过程 1.没有返回值 return 值: 2.用输出参数来代替返回值: 3.输出参数可以有多个 二.参数的传递方式 1. 按位置传递 2. 按名字传递 3.混合传递 ...
- 如何在pyqt中实现平滑滚动的QScrollArea
平滑滚动的视觉效果 Qt 自带的 QScrollArea 滚动时只能在两个像素节点之间跳变,看起来很突兀.刚开始试着用 QPropertyAnimation 来实现平滑滚动,但是效果不太理想.所以直接 ...
- Element Plus 正式版发布啦!🎉🎉
今天,我们非常高兴地宣布 Element Plus 稳定版正式发布.自第一个 commit 起,经过 1 年零 7 个月的持续迭代开发,总计 2635 commits,经过 256 位贡献者所提交的 ...
- Xcode 官方下载地址 https://developer.apple.com/downloads/
Xcode 官方下载地址 https://developer.apple.com/downloads/
- Python调用windows下DLL详解 - ctypes库的使用
在python中某些时候需要C做效率上的补充,在实际应用中,需要做部分数据的交互.使用python中的ctypes模块可以很方便的调用windows的dll(也包括linux下的so等文件),下面将详 ...
- 1、interface/implements 接口与引用
转载请注明来源:https://www.cnblogs.com/hookjc/ 1.类中全部为抽象方法 2.抽象方法前不用加abstract 3.接口抽象方法属性为public 4.成员属性必须为常量 ...
- Android下数据库操作——增删改查
Android下数据库第一种方式增删改查 1.创建一个帮助类的对象,调用getReadableDatabase方法,返回一个SqliteDatebase对象 2.使用SqliteDat ...