identifier of an instance of com.xxx.model.system.xxxObject was altered from 1765 to 1766
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的更多相关文章
- 161117、使用spring声明式事务抛出 identifier of an instance of
今天项目组有成员使用spring声明式事务出现下面异常,这里跟大家分享学习下. 异常信息: org.springframework.orm.hibernate3.HibernateSystemExce ...
- 解决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 ...
- 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 ...
- 【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 ...
- Hibernate异常:identifier of an instance of 错误
今天写项目时,在使用hibernate封装的插入方法时,由于需要同时保存多个数据,导致出现identifier of an instance of 如下代码 :(由于最大最小分数不同所以需要插入两条数 ...
- 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 ...
- Java编译时出现No enclosing instance of type XXX is accessible.
今天在编译Java程序的时候出现以下错误: No enclosing instance of type Main is accessible. Must qualify the allocation ...
- JPA:identifier of an instance of was altered from
由于前台提交的对象,并没有关联对象的数据. 所以要把关联对象赋值一下,在合并集合. WmsOutboundreport entity2 = service.findOne(item.getOutbou ...
- identifier of an instance of **** was altered from **** to *****
在用hibernate getSession().save(entity)方法保存数据库表实体类的时候报这个异常 我的需求是一个请求要往数据库表插两条数据,根据传值判断做了for循环调两次save() ...
随机推荐
- 为什么Redis单线程却能支撑高并发?
作者:Draveness 原文链接:draveness.me/redis-io-multiplexing 最近在看 UNIX 网络编程并研究了一下 Redis 的实现,感觉 Redis 的源代码十分适 ...
- Python各个岗位的开发流程
根据张大美女提供资料微修改,在这谢谢张大美女! 1.python软件开发工程师 1.1 项目启动会 说明项目目标.阶段划分.组织结构.管理流程等关键事项. 1.2 需求调研 由用户提出,描述产品的功 ...
- Synchronized 与Lock的不同之处
Synchronized 与Lock的不同之处 用法不一样.synchronized既可以加在方法上,也可以加载特定的代码块上,括号中表示需要锁的对象.而Lock需要显示地指定起始位置和终止位置.sy ...
- Java线程之间通讯(三)
使用wait和notify方法实现了线程间的通讯,都是Object 类的方法,java所有的对象都提供了这两个方法 1.wait和notify必须配合synchronized使用 2.wait方法释放 ...
- WebApi接收接收日期格式参数时,日期类型(2019-10-08T16:00:00.000Z)后台接收时间少8小时问题
前端使用的是elementui的日期控件,将日期格式的数据提交到webapi后台时,接收到的日期格式少了8小时,这个原因是由于时区引起的,应该在WebApiConfig进行配置转成本地时间,解决少8小 ...
- Hadoop之MapReduce流程
hadoopMapReduce 1. MapReduce流程 2. Shuffle流程 1. MapReduce流程 MapReduce流程 切片: 对数据进行逻辑划分,默认大小是一个block块大小 ...
- [SOLVED] “Error 1067: The process terminated unexpectedly” on Windows 10, 7 & 8
Windows background services enable Windows features function properly. If some errors happen to serv ...
- iOS 简化冗余代码
正在给深圳某家智能家居开发iPad版本,在已经存在的iPhone版上修改,该app的界面采用的是xib.xib相比代码来写界面,快速高效,但是可维护性和可读性太差.言归正传,看到这些代码后,我的心情很 ...
- wireshark分析https数据包解密前后的特点
wireshark分析https数据包解密前后的特点 (一)https解密前 1.协议种类:2种(1)TCP(第四层,传输层)(2)SSL/TLS(第五层,应用层,加解密)2.应用层数据所在数据包特点 ...
- 关于linux的档案随笔
刚才在看鸟哥的linux的私房菜,然后看到的部分是关于linux的档案配置部分,之前就强调过,在linux中所有的一切都是以档案的形式存在的,不过不同的文件有一定的区别,linux中是有副档案这个说法 ...