While trying to insert a new entry to a Many TO Many associated table , i am getting this error: Could not synchronize database state with session
I can understand that this is something deals with getSession() & session.close()
But i cant able to figure it out exactly. For each transaction i am creating a new session. But i close all the sessions at the user logout. i.e: Creating a hibernate session & binds it with HttpSession. Then i destroys it in the user logout.
Some times after working on this issue, i get a different object with the same identifier value was already associated with the session:
error.
All this errors are coming because of not properly opening & closing sessions.
What method you prefer to open and close sessions. My project was creating a web-app. Every single moves in that web-app is deals with DB.
Any suggestions!!!