Browsed by
Tag: org.hibernate.NonUniqueObjectException: a different object with the same identifier value was already associated with the session

[solved] org.hibernate.NonUniqueObjectException: a different object with the same identifier value was already associated with the session

[solved] 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: Meaning of this exception:If we are trying to save the same identifier (primary key) with different session we will get this error. How I solved ?I have used Transaction and session previosly, then I replaced those things with getHibernateTemplate, getHibernateTemplate().saveOrUpdate(myBean); Then issue got resolved. In another scenario,getHibernateTemplate().saveOrUpdate(myBean); for the same I got the same exception that is because I assigned null to myBean after save…

Read More Read More

610 total views, no views today