Caused by: org.hibernate.HibernateException: identifier of an instance of com.xxx.model.system.xxxObject was altered from 1765 to 1766
at org.hibernate.event.def.DefaultFlushEntityEventListener.checkId(DefaultFlushEntityEventListener.java:85)
at org.hibernate.event.def.DefaultFlushEntityEventListener.getValues(DefaultFlushEntityEventListener.java:190)
at org.hibernate.event.def.DefaultFlushEntityEventListener.onFlushEntity(DefaultFlushEntityEventListener.java:147)
at org.hibernate.event.def.AbstractFlushingEventListener.flushEntities(AbstractFlushingEventListener.java:219)
at org.hibernate.event.def.AbstractFlushingEventListener.flushEverythingToExecutions(AbstractFlushingEventListener.java:99)
at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:50)
at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1216)
at org.springframework.orm.hibernate3.HibernateTemplate$28.doInHibernate(HibernateTemplate.java:884)
at org.springframework.orm.hibernate3.HibernateTemplate.doExecute(HibernateTemplate.java:407)
... 119 more

原因:

  对一个实体类进行循环保存, 每次都需要进行new一个对象, 具体暂未深入研究, 应该是和主键以及Hibernate的session等有关

解决方式:

  每次添加对象都使用new创建对象

identifier of an instance of com.xxx.model.system.xxxObject was altered from 1765 to 1766的更多相关文章

  1. 161117、使用spring声明式事务抛出 identifier of an instance of

    今天项目组有成员使用spring声明式事务出现下面异常,这里跟大家分享学习下. 异常信息: org.springframework.orm.hibernate3.HibernateSystemExce ...

  2. 解决org.hibernate.HibernateException: identifier of an instance of com.ahd.entity.Order was altered from2 to 0

    错误信息 严重: Servlet.service() for servlet [springmvc] in context with path [/order] threw exception [Re ...

  3. Caused by: org.hibernate.HibernateException: identifier of an instance of ... is alterde from

    Caused by: org.hibernate.HibernateException: identifier of an instance of ... is alterde from     Hi ...

  4. 【hibernate】错误:org.hibernate.HibernateException: identifier of an instance of com.agen.entity.Monthdetail was altered from xx to xx

    所报错误: org.hibernate.HibernateException: identifier of an instance of com.agen.entity.Monthdetail was ...

  5. Hibernate异常:identifier of an instance of 错误

    今天写项目时,在使用hibernate封装的插入方法时,由于需要同时保存多个数据,导致出现identifier of an instance of 如下代码 :(由于最大最小分数不同所以需要插入两条数 ...

  6. identifier of an instance of xx.entity was altered from xxKey@249e3cb2 to xxKey@74e8f4a3; nested exception is org.hibernate.HibernateException: identifier of an instance of xxentity was altered from错误

    用entityManager保存数据时报错如下 identifier of an instance of xx.entity was altered from xxKey@249e3cb2 to xx ...

  7. Java编译时出现No enclosing instance of type XXX is accessible.

    今天在编译Java程序的时候出现以下错误: No enclosing instance of type Main is accessible. Must qualify the allocation ...

  8. JPA:identifier of an instance of was altered from

    由于前台提交的对象,并没有关联对象的数据. 所以要把关联对象赋值一下,在合并集合. WmsOutboundreport entity2 = service.findOne(item.getOutbou ...

  9. identifier of an instance of **** was altered from **** to *****

    在用hibernate getSession().save(entity)方法保存数据库表实体类的时候报这个异常 我的需求是一个请求要往数据库表插两条数据,根据传值判断做了for循环调两次save() ...

随机推荐

  1. css中常用的选择器和选择器优先级

    css常用的选择器:类选择器,id选择器,元素选择器,伪类选择器,伪元素选择器,属性选择器. 选择器的优先级由四个部分组成:0,0,0,0 一个选择器的具体优先级如下规则确定: ID选择器 加 0,1 ...

  2. P-R曲线深入理解

    P-R曲线就是精确率precision vs 召回率recall 曲线,以recall作为横坐标轴,precision作为纵坐标轴.首先解释一下精确率和召回率. 解释精确率和召回率之前,先来看下混淆矩 ...

  3. python基础 — 参数组合

    参数组合 >>>def f1(a, b, c=0, *args, **kw): ... print('a =', a, 'b =', b, 'c =', c, 'args =', a ...

  4. python实战项目 — 爬取 妹子图网,保存图片到本地

    重点: 1. 用def函数 2. 使用 os.path.dirname("路径保存") , 实现每组图片保存在独立的文件夹中 方法1: import requests from l ...

  5. 协议——SPI

    SPI(Serial Peripheral interface)是由摩托罗拉公司定义的一种串行外围设备接口,是一种高速.全双工.同步的通信总线,只需要四根信号线即可,节约引脚,同时有利于PCB的布局. ...

  6. dubbo中使用动态代理

    dubbo的动态代理也是只能代理接口 源码入口在JavassistProxyFactory中 public class JavassistProxyFactory extends AbstractPr ...

  7. THUPC&CTS&APIO2019:Far Away

    流水账~ THUPC nmdwsmduliu! THUPC Day -INF~Day -2 大概就是自己做题和每周两次的考试,lsy和fcw两个外校的来吊打我们qwqqq THUPC Day -1 Z ...

  8. 方法2:使用Jenkins构建Docker镜像 --SpringCloud

    前提意义: SpringCloud微服务里包含多个文件夹,拉取仓库的所有代码,然后过根据选项参数使用maven编译打包指定目录的jar,然后再根据这个目录的Dockerfile文件制作Docker镜像 ...

  9. docker容器日志管理(清理)

    原文:docker容器日志管理(清理) 前言 在使用docker容器时候,其日志的管理是我们不得不考虑的事情.因为docker容器的日志文件会占据大量的磁盘空间.下面介绍的就是对docker容器日志的 ...

  10. JS基础_强制类型转换-Number

    <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title> ...