Best practice to avoid 'A different object with the same identifier value was already associated with the session'
I think it's a common procedure to load an entitiy via hibernate store it in a session variable change properies save it later What is a common practice to avoid the error A different object with the same identifier value was already associated with the session when the current session has already loaded the object under any circumstances? Use merge? Avoid loading the same object before? Flush the hibernate-session and detach the other Instance? Retrieve the object from the session an manually copy the changes from the instance in the session? Use DTOs and only store the id in the session hand
0 upvotes
View original discussion ↗
Comments
Sign in or sign up to comment and upvote.
No comments yet.