commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christian Hufgard <>
Subject Re: DBCP connection takes (very) long
Date Sun, 31 Dec 2006 14:58:28 GMT
Hello Peter,

If the execution of the queries lasts a long time, this also might be
cause of deadlocks. The fact that you have a lot of idle connections
also indicates, that your application is not waiting for connections.

Have you tried logging execution time of each query?
How do you test your application? Maybe you have to less tomcat
workers so your requests are queued.

You could also test your application outside of tomcat to see, if
there are any problems.


Sunday, December 31, 2006, 3:12:09 PM, you wrote:

> Hello,

> Not sure this is the right forum to ask DBCP questions. If not I would
> appreciate if someone could tell me where I should ask the question.

> Anyway, I have DBCP 1.2.1 and Tomcat 6.02 configured with a mySql backend.

> I have configured the pool through a jndi datasource,

>           <Resource name="jdbc/PurlDB" auth="Container" type="javax.sql.DataSource"
> factory="org.apache.commons.dbcp.BasicDataSourceFactory"
>                   initialSize="200"
>                   maxActive="200"
>                   maxIdle="200"
>                   maxWait="10000"
>                   username="user"
>                   password="***"
>                   driverClassName="com.mysql.jdbc.Driver"
>                   url="jdbc:mysql://"
>                   />

> The code to get the connection just invokes getConnection on the Datasource
> instance.

> Everything works fine but when I start stress testing the tomcat servlet
> app, some of the connections take a very long time (e.g. >5 minutes). I have
> added logging to write out idle and active connections, and there always
> seem to be lots of idle connections left.

> Would anybody have any guidance as on how to identify and hopefully fix the
> issue?

> Thanks,

> Peter

Best regards,

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message