Spring + Hibernate : a different object with the same identifier value was already associated with the session

Use merge(). The exception means that the current session is already aware of the entity you are passing. If not, check how you have overridden hashCode() and equals() – it should return different values for different entities.

Leave a Comment