org.hibernate.NonUniqueObjectException: a different object with the same identifier value was already associated with the session异常解决办法

org.hibernate.NonUniqueObjectException: a different object with the same identifier value was already associated with the session异常解决办法

为什么还会说已经存在相同的session了呢。然后每次将项目重启后第一次编辑的时候问题不会触发,只有当第二次操作的时候才会出现这个问题。

解决办法:关闭session。好好检查操作完成后有没有关闭会话。

原文地址:https://www.cnblogs.com/gavinYang/p/3728762.html