|
threads and hibernate
I run a thread that makes connections with hibernate, they are querys of hibernate and if the table has been updated I insert records
It works ok but when I execute the thread, after 2 minutes lost the database connection...
do you know what is the problem?
how can I fix?
org.hibernate.exception.GenericJDBCException: Cannot open connection
at org.hibernate.exception.SQLStateConverter.handledN onSpecificException
(SQLStateConverter.java:91)
at org.hibernate.exception.SQLStateConverter.convert( SQLStateConverter.j
ava:79)
at org.hibernate.exception.JDBCExceptionHelper.conver t(JDBCExceptionHelp
er.java:43)
at org.hibernate.exception.JDBCExceptionHelper.conver t(JDBCExceptionHelp
er.java:29)
at org.hibernate.jdbc.ConnectionManager.openConnectio n(ConnectionManager
.java:307)
at org.hibernate.jdbc.ConnectionManager.getConnection (ConnectionManager.
java:109)
at org.hibernate.jdbc.AbstractBatcher.prepareQuerySta tement(AbstractBatc
her.java:105)
at org.hibernate.loader.Loader.prepareQueryStatement( Loader.java:1561)
at org.hibernate.loader.Loader.doQuery(Loader.java:66 1)
at org.hibernate.loader.Loader.doQueryAndInitializeNo nLazyCollections(Lo
ader.java:223)
at org.hibernate.loader.Loader.doList(Loader.java:214 7)
at org.hibernate.loader.Loader.listIgnoreQueryCache(L oader.java:2026)
at org.hibernate.loader.Loader.list(Loader.java:2021)
at org.hibernate.loader.hql.QueryLoader.list(QueryLoa der.java:369)
at org.hibernate.hql.ast.QueryTranslatorImpl.list(Que ryTranslatorImpl.ja
va:298)
at org.hibernate.engine.query.HQLQueryPlan.performLis t(HQLQueryPlan.java
:137)
at org.hibernate.impl.SessionImpl.list(SessionImpl.ja va:1014)
at org.hibernate.impl.QueryImpl.list(QueryImpl.java:7 9)
at com.desige.webDocuments.persistent.utils.Hibernate Util.createQuery(Hi
bernateUtil.java:176)
at com.focus.wonderware.actions.HandlerProcesosWonder Ware.HiloChecSacopI
ntouchWonderwareHijo(HandlerProcesosWonderWare.jav a:383)
at com.focus.wonderware.actions.HandlerProcesosWonder Ware.getTagnameWond
erwareQueStanPreconfiguradosInSacopIntouch(Handler ProcesosWonderWare.java:603)
at com.focus.wonderware.intocuh_sacop.actions.HiloChe cheaSacop_Intouch.r
unTask(HiloChecheaSacop_Intouch.java:103)
at com.focus.wonderware.intocuh_sacop.actions.HiloChe cheaSacop_Intouch.r
un(HiloChecheaSacop_Intouch.java:64)
Caused by: org.apache.commons.dbcp.SQLNestedException: Cannot get a connection,
pool exhausted
at org.apache.commons.dbcp.PoolingDataSource.getConne ction(PoolingDataSo
urce.java:103)
at org.apache.commons.dbcp.BasicDataSource.getConnect ion(BasicDataSource
.java:540)
at org.hibernate.connection.DatasourceConnectionProvi der.getConnection(D
atasourceConnectionProvider.java:69)
at org.hibernate.jdbc.ConnectionManager.openConnectio n(ConnectionManager
.java:304)
... 18 more
Caused by: java.util.NoSuchElementException: Timeout waiting for idle object
at org.apache.commons.pool.impl.GenericObjectPool.bor rowObject(GenericOb
jectPool.java:756)
at org.apache.commons.dbcp.PoolingDataSource.getConne ction(PoolingDataSo
urce.java:95)
|