commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Preetam Palwe" <preet...@aftek.com>
Subject [Commons DBCP] Cannot get a connection, pool exhausted
Date Tue, 18 Apr 2006 14:59:32 GMT
Hi All,
	I am using DBCP with Hibernate, when I deploy my server application it
works fine for some hours and after that for any successive request it
throws

<stacktrace>
org.hibernate.exception.GenericJDBCException: Cannot open connection
        at
org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLSta
teConverter.java:82)
        at
org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:70)
        at
org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java
:43)
        at
org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java
:29)
        at
org.hibernate.jdbc.AbstractBatcher.openConnection(AbstractBatcher.java:427)
        at org.hibernate.jdbc.JDBCContext.connect(JDBCContext.java:168)
        at org.hibernate.jdbc.JDBCContext.connection(JDBCContext.java:103)
        at
org.hibernate.transaction.JDBCTransaction.begin(JDBCTransaction.java:49)
        at
org.hibernate.transaction.JDBCTransactionFactory.beginTransaction(JDBCTransa
ctionFactory.java:24)
        at
org.hibernate.jdbc.JDBCContext.beginTransaction(JDBCContext.java:231)
        at
org.hibernate.impl.SessionImpl.beginTransaction(SessionImpl.java:1073)
	  ...........
        at java.util.TimerThread.mainLoop(Timer.java:432)
        at java.util.TimerThread.run(Timer.java:382)
Caused by: org.apache.commons.dbcp.SQLNestedException: Cannot get a
connection, pool exhausted
        at
org.apache.commons.dbcp.PoolingDataSource.getConnection(PoolingDataSource.ja
va:103)
        at
org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:5
40)
        at
com.xxx.DBCPConnectionProvider.getConnection(DBCPConnectionProvider.java:243
)
        at
org.hibernate.jdbc.AbstractBatcher.openConnection(AbstractBatcher.java:424)
        ... 11 more
Caused by: java.util.NoSuchElementException: Timeout waiting for idle object
        at
org.apache.commons.pool.impl.GenericObjectPool.borrowObject(GenericObjectPoo
l.java:756)
        at
org.apache.commons.dbcp.PoolingDataSource.getConnection(PoolingDataSource.ja
va:95)
        ... 14 more
</stacktrace>

Can anyone please tell me whets going wrong ?
here is my configuration
	j2sdk 1.4.2_6
	hibernate 3.0
	commons-pool 1.2
	commons-dbcp 1.2.1
	fedora core 3
and
	hibernate config file looks like

	<property
name="hibernate.connection.provider_class">com.xxx.DBCPConnectionProvider</p
roperty>
	<property name="hibernate.connection.pool_size">20</property>
	<property name="hibernate.dbcp.initialSize">10</property>
	<property name="hibernate.dbcp.maxWait">10000</property>
	<property name="hibernate.dbcp.validationQuery">select 1</property>

I have taken com.xxx.DBCPConnectionProvider from
http://wiki.apache.org/jakarta-commons/DBCP/Hibernate


Thanks&Regards
~Preetam


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Mime
View raw message