commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Karol R├╝ckschloss <karol.rueckschl...@iqnex.com>
Subject Re: DBCP uses thousands of ports connecting to MySQL on XP (and f ails )
Date Fri, 02 May 2003 08:51:05 GMT
Knight, Digby wrote:

>InitialContext ctx = new InitialContext();
>DataSource ds = (DataSource) ctx.lookup("java:comp/env/jdbc/datasource");
>// Working here - found ds okay from <GlobalResources>
>Connection conn = ds.getConnection();
>// Check netstat - thousands of connections to port 3306
>
I had a similar problem with the DBCP / Tomcat integration (pools JNDI 
datasource connections by default). And the solution for my problem was 
quite simple - I misunderstood the resource parameters "maxActive" and 
"maxIdle".
maxActive = amount of connections that are open and put into the pool 
upon first request
... I did the mistake that I put the 30000 in maxActive instead of 
maxIdle ...

Maybe this is relevant to you. I never explicitelly used DBCP, I only 
implicitelly used the DBCP integrated with Tomcat / transparrent 
connection pooling.

KarolR



Mime
View raw message