[url]http://FrancoisNadeau.com[/url]
Francois Nadeau wrote:Hello Juan,
Have you verified that all hibernate sessions are closed (or at least disconnected) after being used?
Cheers,
Francois
Paul Sturrock wrote:By looking at the code where you close the Session?
Paul Sturrock wrote:HibernateDaoSupport sounds like a Spring class. Is it? There should be something actively closing the sessions. Depending on the pattern your code uses this will either be explicit in the code, or use another mechanism (such as the end of a JTA transaction) to close it for you. If neither of these are there then nothing closes the sessions, hence the error you are seeing.
Benjamin Winterberg wrote:Normally Springs HibernateDaoSupport manages the hibernate session by itself. The internally used HibernateTemplate opens the hibernate session and closes the session on transaction#commit(). Maybe there's some misconfiguration in your project which brokes springs session management?
Also HibernateDaoSupport isnt the right thing to implement DAOs anymore. Take a look at this blog entry for a detailed explanation:
http://bwinterberg.blogspot.com/2009/08/comparison-implementing-hibernate-daos.html
You can inspect the HibernateStatistics to check if all opened sessions are correctly closed (see SessionFactory#getStatistics()).
Juan Manuel Diaz wrote:
Benjamin Winterberg wrote:Normally Springs HibernateDaoSupport manages the hibernate session by itself. The internally used HibernateTemplate opens the hibernate session and closes the session on transaction#commit(). Maybe there's some misconfiguration in your project which brokes springs session management?
Also HibernateDaoSupport isnt the right thing to implement DAOs anymore. Take a look at this blog entry for a detailed explanation:
http://bwinterberg.blogspot.com/2009/08/comparison-implementing-hibernate-daos.html
You can inspect the HibernateStatistics to check if all opened sessions are correctly closed (see SessionFactory#getStatistics()).
We will try adding a finally block invoking the method "releaseSession(session)" after the catch of the DataAccessException. If it works, i will post it!...
Best Regards,
JM
[url]http://FrancoisNadeau.com[/url]
Paul Sturrock wrote:With Spring you should not need to explicitly close the session, it is being managed by Spring itself. As Benjamin pointed out earlier if this is not happening then there is some mistake in your Spring configuration. I'd look there rather than trying to code round the mistake.
Who among you feels worthy enough to be my best friend? Test 1 is to read this tiny ad:
free, earth-friendly heat - a kickstarter for putting coin in your pocket while saving the earth
https://coderanch.com/t/751654/free-earth-friendly-heat-kickstarter
|