首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 软件管理 > 软件架构设计 >

自己遇到的hibernate异常

2012-10-08 
自己遇到的hibernate错误1 . a different object with the same identifier value was already associated

自己遇到的hibernate错误

1 . a different object with the same identifier value was already associated with the session: [VoBean.Employee#2]
??原因:session中已经存在相同的对象,一般发生在级联修改该对象的set集合中对象已经存在相同的对象 
解决:对象的set集合设置为一个空的set集合!
??
2.object references an unsaved transient instance - save the transient instance before flushing: VoBean.Department;
?nested exception is org.hibernate.TransientObjectException: object references an unsaved transient instance - save the
?transient instance before flushing: VoBean.Department?
原因:? 一个对象引用了一个没有保存对象(一般该对象为null)

解决 : 确保引用对象不为空

热点排行