Hibernate经典异常:org.hibernate.NonUniqueObjectException: a different object with the same identifier

版权声明:转载请标注来源:https://me.csdn.net/qq_37844454 https://blog.csdn.net/qq_37844454/article/details/83052177

最近在用Hibernate做数据修改和删除的时候,遇到一个Hibernate的经典异常之一:

看了将近两天的各种博客、论坛,花费了大量的精力尝试了 session.evict()、session.clear()、session.merge()等博客、论坛上的数种方法以及自己的各种猜想以及方法以后。。。。。。。。。

终于。。。。。还是回到了原点!!!

还是一样的:org.hibernate.NonUniqueObjectException: a different object with the same identifier value was already associated with the session: 

让人非常郁闷!!!我也无能为力了,只能后面再慢慢测试了。

各位大佬有先见之明的希望提点提点我。

猜你喜欢

转载自blog.csdn.net/qq_37844454/article/details/83052177