关于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: Error during managed flush [Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1]
查阅许多博客得出了自己的理解,请大家指教:
由于存在隐藏表单进行回显,导致提交时value不是Null,而是"",而我设置的主键生成策略是uuid,所以无法赋值导致错误,解决方法是隐藏表单外面添加了if判断!

修改后为

关于Error during managed flush [Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1]错误的更多相关文章
- Nhibernate Batch update returned unexpected row count from update; actual row count: 0 解决方案
		以前在session.Update(object).没发现啥问题,最近update的时候,老是报错:Nhibernate Batch update returned unexpected row co ... 
- 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 ... 
- 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
		这是因为没有设置要更新的主键导致的,只要设置了要更新的主键就能更新成功(没有主键当然不能更新) 
随机推荐
- "远程服务器返回错误: (500) 内部服务器错误"错误处理
			公司购买的百傲瑞达一卡通软件,提供Restful API调用,使用SoapUI能够调用成功,但在C#里用代码调用时一直报错:"远程服务器返回错误: (500) 内部服务器错误" 找 ... 
- 表单、框架结构的大概、CSS开头(选择器以及常用属性)
			<!--为网页添加图标,写在头部--> <link rel="shortcut icon" href="favicon.ico(路径)" ty ... 
- Servlet+纯java+MySQL实现课程信息的增删改查
			Dbutil: package com.zh.util; import java.sql.Connection; import java.sql.DriverManager; import java. ... 
- K8S学习笔记之ETCD启动失败注意事项
			最近搭建K8S集群遇到ETCD的报错,报错信息如下,一定要关闭防火墙.iptables和SELINUX,三个都要关闭!! Mar 26 20:39:24 k8s-m1 etcd[6437]: heal ... 
- Java 实现追加excle文件内容
			Java 实现追加excle文件内容 一.示例一:excle(.xlsx) //jar import java.io.BufferedReader; import java.io.File; impo ... 
- 树莓派3B安装LEDE
			本来想安装openwrt的,但是op官方没有支持pi3,甚至op都不怎么发新版了,仅LEDE分支有缓慢的更新..离题了,之前给pi3装过LEDE,体验不是很好.今天到openwrt官网看了下,发现之前 ... 
- inotify+rsync架构实现实时同步
			前序 使用inotify+rsync架构实现(文件夹/文件)实时同步, 双机之间需要ssh免密码配置(两步完成ssh免密码登录) 环境 客户端:192.168.137.176 (rsync + ino ... 
- luoguP1850 换教室
			luoguP1850 换教室 链接 https://www.luogu.org/problemnew/show/P1850 思路 状态很显然就是f[n][k][0/1] 前i次,用了k次机会,当前是在 ... 
- 如何恢复IIS出厂默认设置
			How to restore IIS settings and Default Web Site? http://superuser.com/questions/704850/how-to-resto ... 
- spring-cloud-config——Quick Start
			参考资料: https://cloud.spring.io/spring-cloud-static/spring-cloud-config/1.4.0.RELEASE/single/spring-cl ... 
