Hi all,
I must have misunderstanding something about session disconnecting.
Sometime I get an exception Could not synchronise session with database, so before making manual flush or commit, I check if !session.isConnected or session.connection().isClosed() and if that's the case, I call session.reconnect() to avoid this problem.
I haven't been able yet to find why these hazardous disconnection happen, I'm using hibernate 2.1 incorparated in my app in a J2EE app server JOnAS. So it is confogured the work with a jonas datasource.
The problem is that I get an net.sf.hibernate.NonUniqueObjectException :a different object with the same identifier value was already associated with the session: 3, of class: org.... if I do the reconnected and this happen when I call session.flush.
I was used to have this when I performed a save instead of a update. But the incriminated object is updated and not saved.
So???
Any idead
Vlad
|