identifier of an instance of bean was altered from 1 to 2(持久化对象ID变更)
来源:互联网 发布:springmvc ajax json 编辑:程序博客网 时间:2024/05/01 10:36
今天遇到个怪问题,hibernate修改外键id时出现:
org.springframework.orm.hibernate3.HibernateSystemException: identifier of an instance of xx altered from 2677 to 2672;
nested exception is org.hibernate.HibernateException: identifier of an instance of com.yongjun.tdms.model.CustomerRelationship.contactArchives.ContactArchives altered from 2677 to 2672
Caused by: org.hibernate.HibernateException: identifier of an instance of xx altered from 2677 to 2672
at org.hibernate.event.def.DefaultFlushEntityEventListener.checkId(DefaultFlushEntityEventListener.java:51)...at java.lang.Thread.run(Thread.java:619)
结果在网上看到大神的解决方法
引用:
应该是缓存导致,save前先clear()试试dao.clear();dao.save(entity);
自己加了个:
public void storeContractAdditionalInfo(ContractAdditionalInfo ai){super.getHibernateTemplate().clear();//加的清缓存super.store(ai);}
ok,问题解决。希望对大家有帮助
阅读全文
0 0
- identifier of an instance of bean was altered from 1 to 2(持久化对象ID变更)
- HibernateException异常:identifier of an instance of bean was altered from 1 to 1(持久化对象ID变更)
- identifier of an instance of was altered from to null
- identifier of an instance of was altered from to null
- identifier of an instance ...... altered from ** to **
- 异常:identifier of an instance of cn.ebank.pojo.News was altered from 2 to 2;
- identifier of an instance of XXX was altered from 75
- org.hibernate.HibernateException: identifier of an instance of XXX was altered from X to X
- 关于identifier of an instance of Object was altered from 6 to 6异常解决问题
- org.hibernate.HibernateException: identifier of an instance of XXX was altered from X to X
- merge对比引发的identifier of an instance of entity was altered from .. to ..报错
- identifier of an instance of com.you.hibernate.model.TStudentInfo was altered from 6 to 7
- org.hibernate.HibernateException: identifier of an instance of XXX was altered from X to X
- Hibernate学习: 异常 identifier of an instance of com.zhssh.vo.TUser was altered from 1 to 1
- EJB3 Exception:identifier of an instance of net.model.entity.Role was altered from 2 to 0
- SSH项目报identifier of an instance of xxx was altered from N to 1的解决方案
- identifier of an instance was altered from XXXX to XXXX解决
- identifier of an instance ... altered from num1 to num2
- 安装ubuntu双系统
- 详解Hibernate中的二级缓存
- 《数据库SQL实战》查找最晚入职员工的所有信息
- 正确编译DuiLib的方法
- DM8168 --交叉编译ARM版 Qt (qt-everywhere-opensource-src-4.8.4)
- identifier of an instance of bean was altered from 1 to 2(持久化对象ID变更)
- MySQL索引类型总结和使用技巧以及注意事项
- 安装RYU,以及安装RYU的GUI
- 问号 的判断
- 什么是硬分叉,什么是软分叉,什么是共识?
- Qt-俄罗斯方块
- cocoapods创建共有库过程中遇到的坑以及版本删除
- Nginx之代理配置以及负载均衡
- UIbutton设置圆角边框(Xcode8.3.3+swift3)