Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

DBCP issue - Timeout waiting for idle object

 
Wim Folkerts
Greenhorn
Posts: 19
Java jQuery Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello all,

We have been migrated a couple of months ago to the DBCP (Apache's Database Connectiong Pooling) setup for creating database connections (http://commons.apache.org/dbcp/configuration.html). We had a long period of testing in order to be sure the change in configuration would work. This week we've implemented the DBCP migration and the first errors came...

1. First of all we did not specify the maxWait attribute (default indefinitely) and then after 5 hours running the application just freezes.

2. So based on the topic "Intermittent dB Connection Failures" on the site http://tomcat.apache.org/tomcat-5.5-doc/jndi-datasource-examples-howto.html we changed it to maxWait="15000". However then we got the below error after about 3 hours:
java.util.NoSuchElementException: Timeout waiting for idle object
at org.apache.tomcat.dbcp.pool.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:958)
at org.apache.tomcat.dbcp.dbcp.PoolingDataSource.getConnection(PoolingDataSource.java:96)
at org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.java:880)


I've defined the JDBC resource in my <TOMCAT_6_HOME>\conf\context.xml as below:


Upon looking at the "Tomcat Web Application Manager" at about 15 session are active daily, so that is not a high workload for the DBCP configuration. Also connections are closed in the finally clause.

Can anyone advice how to overcome the above described errors?

Thanks in advance

Wim
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic