Beginner |
|
Joined: Fri Mar 19, 2004 7:21 am Posts: 20
|
Hi all,
I am running Tomcat 5.0.28 under windows with Hibernate 2.1.7. I am using the standard ThreadLocal HibernateUtil pattern. When I enable DBCP abandoned session logging under Tomcat I get large numbers of Hibernate sessions that were never closed. Is hibernate not cleaning up after itself properly and returning connections to the pool or is this something my code is supposed to do manually?
DBCP object created 2005-05-25 15:36:11 by the following code was never closed:
java.lang.Exception
at org.apache.commons.dbcp.AbandonedTrace.init(AbandonedTrace.java:96)
at org.apache.commons.dbcp.AbandonedTrace.<init>(AbandonedTrace.java:79)
at org.apache.commons.dbcp.DelegatingStatement.<init>(DelegatingStatement.java:60)
at org.apache.commons.dbcp.DelegatingPreparedStatement.<init>(DelegatingPreparedStatement.java:65)
at org.apache.commons.dbcp.DelegatingConnection.prepareStatement(DelegatingConnection.java:185)
at org.apache.commons.dbcp.PoolingDataSource$PoolGuardConnectionWrapper.prepareStatement(PoolingDataSource.java:278)
at net.sf.hibernate.impl.BatcherImpl.getPreparedStatement(BatcherImpl.java:260)
at net.sf.hibernate.impl.BatcherImpl.getPreparedStatement(BatcherImpl.java:235)
at net.sf.hibernate.impl.BatcherImpl.prepareQueryStatement(BatcherImpl.java:66)
at net.sf.hibernate.loader.Loader.prepareQueryStatement(Loader.java:784)
at net.sf.hibernate.hql.QueryTranslator.iterate(QueryTranslator.java:864)
at net.sf.hibernate.impl.SessionImpl.iterate(SessionImpl.java:1618)
at net.sf.hibernate.impl.QueryImpl.iterate(QueryImpl.java:27)
at core.domain.persist.AdamAssetDAO.sqlFindAssets(AdamAssetDAO.java:774)
The ramifications are that under heavy load my database pool is exhausted and I get the following exception.
java.util.NoSuchElementException: Timeout waiting for idle object
at org.apache.commons.pool.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:756)
Regards,
Damon.
|
|