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

原因:再给数据库中放入新数据的时候加了id,然而有了id,系统默认为修改方法就回去在库中查找,所以出错。

解决方法:将生成的id去掉。

20.org.hibernate.StaleStateException: Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1的更多相关文章

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

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

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

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

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

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

  6. Nhibernate Batch update returned unexpected row count from update; actual row count: 0 解决方案

    以前在session.Update(object).没发现啥问题,最近update的时候,老是报错:Nhibernate Batch update returned unexpected row co ...

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

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

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

  9. 异常:Batch update returned unexpected row count from update [0]; actual row count: 0;

    使用了hibernate的主键生成策略,而在程序中又主动去设置了主键值.<class name="ProductRegion" table="PRODUCT_REG ...

随机推荐

  1. 阿牛的EOF牛肉串

    #include <iostream>using namespace std;long long s0,s1,s2,s3;int main(){ int i,n; while(cin> ...

  2. git教程--git版本库的使用

    向版本控制器提交文件 我们已经成功地添加并提交了一个readme.txt文件,现在,是时候继续工作了,于是,我们继续修改readme.txt文件,改成如下内容: Git is a distribute ...

  3. nginx1.9.4 +php 5.5.29+yii2.0配置手册

    nginx1.9.4 +php 5.5.29+yii2.0配置手册 目录 一.    php5.5.29安装配置    2 二.    nginx1.9.4安装配置    2 三.    yii2.0 ...

  4. Nhibernate 映射关系,一对多 多对一与多对手在映射文件中的体现。

    今天做了第一个Nhibernate项目,摸着石头过河,学到了一些东西,在这里将自己总结体会到的一些映射关系写出来,与大家分享,由于是初学者,如果有不对的地方希望大家能够指出来. 首先要说明要建立的几张 ...

  5. sqlmap新手注入

    一 什么是sqlmap sqlmap is an open source penetration testing tool that automates the process of detectin ...

  6. yacc和lex在ubuntu上安装

    在编译boa webserver源码的时候./configure的过程中遇到找不到yacc的提示. 采用以下失败: sudo apt-get install yacc lex   应替换为: sudo ...

  7. HTTP生命周期

    HTTP生命周期 Http 请求 AspNet_ISAIP.DLL (ISAPI扩展,独立于站点外,用于可扩展的桥梁), w3wp.exe (net工作进程) IIS6 以上,6以下为aspnet_w ...

  8. Java日期时间使用(转)

    Java日期时间使用总结 转自:http://lavasoft.blog.51cto.com/62575/52975/   一.Java中的日期概述   日期在Java中是一块非常复杂的内容,对于一个 ...

  9. 未能加载文件 %CommonDir%\dte90a.olb。未能找到该文件,因此解决此问题的尝试失败

    分类: 日常应用问题 2012-08-04 10:53 914人阅读 评论(0) 收藏 举报 microsoft2010c vs2010 启动时提示 ------------------------- ...

  10. delphi 对TThread扩充TSimpleThread

    对线程的使用,是每个开发者都应该熟练掌握的,也是进阶的重要一环. 可以这样说,没有线程,连界面假死的问题都解决不了,就更别谈并行处理来提高效率了. 本例对线程进行改进,打造一个基础的线程,以后线程应用 ...