控制台报错:

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]错误的更多相关文章

  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 ...

  2. 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 ...

  3. 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 ...

  4. Batch update returned unexpected row count from update [0] 异常处理

    在one-to-many时遇到此异常,本以为是配置出错.在使用s标签开启debug模式,并在struts2主配置文件中添加异常映射,再次提交表单后得到以下异常详情. org.springframewo ...

  5. 关于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 ...

  6. 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 ...

  7. 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 ...

  8. 错误Batch update returned unexpected row count from update [0]; actual row count: 0;

    参考:http://blog.csdn.net/ssyan/article/details/7471343 也是出现类似问题,在前台页面的隐藏域中判断id是否为null,而没有去判断是否为空字符串. ...

  9. hibernate 解决 org.hibernate.StaleStateException: Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1

    这是因为没有设置要更新的主键导致的,只要设置了要更新的主键就能更新成功(没有主键当然不能更新)

随机推荐

  1. dotnet Core 异步任务

    使用线程池中线程的任务启动方式 线程池提供了一个后台线程的池,独自管理线程,按需增加或减少线程池中的线程数.线程池中的线程用于执行一些动作后仍然返回线程池中. using System; using ...

  2. oracle(2)

    create table aaa( id number, name varchar2(100) ); select decode((select max(id) from aaa),null,'x', ...

  3. PHP5.6 Dockerfile

    FROM centos COPY ["src","/src"] RUN groupadd -g 1000 www \ && useradd -u ...

  4. Docker Swarm 环境搭建

    Docker Swarm 环境搭建 swarm 使用前提 1.Docker版本1.12+ Docker升级教程:https://www.cnblogs.com/xiangsikai/p/9935894 ...

  5. docker入门篇 部署springboot项目

    安装docker Ubuntu16.04安装Docker 使用docker 注册docker服务 systemctl enable docker systemctl status docker 然后在 ...

  6. P5205 【模板】多项式开根

    思路 按如下式子计算即可 \[ B(x)=\frac{A(x)+B'^2(x)}{2B'(x)} \] 代码 // luogu-judger-enable-o2 #include <cstdio ...

  7. 《温故而知新》JAVA基础一

    一:基本环境 种类 javaSE(核心语法)+javaME(移动设备)+Java EE(JSP/服务等) JVM(java虚拟机) abc.java(源文件)--编译器--abc.class 字节码文 ...

  8. Linux之文件目录

    一.Linux的目录结构 1.概览 2.树状目录结构 说明: /root:该目录为系统管理员用户主目录 /bin:即Binary,存放着系统必备执行命令 /boot:这里存放的是启动Linux时使用的 ...

  9. Windows 用bat脚本带配置启动redis,并用vb脚本使其在后台运行。

    最近,在Windows上用开发PHP程序,需要用到Redis,每天要打开一个运行redis-server.exe的窗口这样比较烦,因为窗口就一直打开着,不能关闭. 所以就想着通过写脚本的方式,让他在后 ...

  10. [Hibernate] 通过 properties 类和 hql 语句进行动态查询

    //需要保证Emp和EmpProperties中的setter和getter以及属性以及 参数占位符(:eName) 的一致//动态查询 @Test public void test4(){ EmpP ...