org.hibernate.NonUniqueObjectException: a different object with the same identifier value was already associated with t
org.hibernate.NonUniqueObjectException: a different object with the same identifier value was already associated with the session:
Hibernate经常用到的一个错误。解决的方法:
1.将session清空一下,因为已经有一个ID一样的对象存在于内存中了。
session.clear();
2.判断是否存在和更新最好分开做。
3.还没想到