Return-Path: Mailing-List: contact commons-user-help@jakarta.apache.org; run by ezmlm Delivered-To: mailing list commons-user@jakarta.apache.org Received: (qmail 45072 invoked from network); 2 May 2003 08:50:55 -0000 Received: from mail6.nci.de (HELO nci-mail.nci.de) (212.52.224.2) by daedalus.apache.org with SMTP; 2 May 2003 08:50:55 -0000 Received: from iqnex.com ([213.39.169.248]) by nci-mail.nci.de (Post.Office MTA v3.5.3 release 223 ID# 127-60718U1000L100S0V35) with ESMTP id de for ; Fri, 2 May 2003 09:49:13 +0100 Message-ID: <3EB23179.6070406@iqnex.com> Date: Fri, 02 May 2003 10:51:05 +0200 From: =?ISO-8859-1?Q?Karol_R=FCckschloss?= User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.3) Gecko/20030312 X-Accept-Language: de, en-us, en, sk MIME-Version: 1.0 To: Jakarta Commons Users List Subject: Re: DBCP uses thousands of ports connecting to MySQL on XP (and f ails ) References: <17A1B0CC7691D511B78E00508BAE66BF038439F8@GBHENEX04VSA> In-Reply-To: <17A1B0CC7691D511B78E00508BAE66BF038439F8@GBHENEX04VSA> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Knight, Digby wrote: >InitialContext ctx = new InitialContext(); >DataSource ds = (DataSource) ctx.lookup("java:comp/env/jdbc/datasource"); >// Working here - found ds okay from >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