Possible duplicate:
Hibernate: another object with the same identifier value has already been associated with the session
When I try to insert a new record into a many-many multi-linked table, I get this error: Could not synchronize database state with session
I can understand that this is something dealing with getSession () and session.close ()
But I can’t figure it out for sure. For each transaction, I create a new session. But I close all sessions when the user logs out. ie: create a hibernation session and bind it to an HttpSession. Then I destroy it when the user exits.
Several times after working on this problem, I get an error a different object with the same identifier value was already associated with the session:.
All these errors occur due to improper opening and closing of sessions.
Which method do you prefer to open and close. My project was building a web application. Everyone moves in the fact that the web application deals with the database.
Any suggestions!!!
user405398
source
share