title: Hibernate Error: org.hibernate.NonUniqueObjectException: a different object with the same identifier value was already associated with the session
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/3553200/hibernate-different-object-with-the-same-identifier-value-was-already-associate">Hibernate: different object with the same identifier value was already associated with the session</a>  </p>
  </blockquote>
  
  
  
  <p>I have got almost the same problem like that <a href="https://stackoverflow.com/questions/1074081/hibernate-error-org-hibernate-nonuniqueobjectexception-a-different-object-with">user</a>.</p>
  
  <p>In my situation I load one entity from db, I convert this entity into a DataTransferObject, then I want to edit one attribute, after that I convert it back into an entityObject, then I update that entity and hibernate throws following error:</p>
  
  <pre><code>Hibernate Error: org.hibernate.NonUniqueObjectException: a different object with the same identifier value was already associated with the session
  </code></pre>
  
  <p>Apparently, the problem is that the object I retrieve from db has the same id as the one I want to update (like it should be) BUT those are not the same objects! </p>
  
  <p>How to manage that?
  Thank you for help...</p>