Return-Path: Delivered-To: apmail-commons-user-archive@www.apache.org Received: (qmail 83981 invoked from network); 14 Nov 2009 09:08:05 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 14 Nov 2009 09:08:05 -0000 Received: (qmail 27362 invoked by uid 500); 14 Nov 2009 09:08:04 -0000 Delivered-To: apmail-commons-user-archive@commons.apache.org Received: (qmail 27245 invoked by uid 500); 14 Nov 2009 09:08:02 -0000 Mailing-List: contact user-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Commons Users List" Delivered-To: mailing list user@commons.apache.org Received: (qmail 27235 invoked by uid 99); 14 Nov 2009 09:08:02 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 14 Nov 2009 09:08:02 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [212.27.42.2] (HELO smtp2-g21.free.fr) (212.27.42.2) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 14 Nov 2009 09:07:53 +0000 Received: from smtp2-g21.free.fr (localhost [127.0.0.1]) by smtp2-g21.free.fr (Postfix) with ESMTP id 9A7424B004F for ; Sat, 14 Nov 2009 10:07:30 +0100 (CET) Received: from [192.168.1.2] (dom38-1-82-236-152-73.fbx.proxad.net [82.236.152.73]) by smtp2-g21.free.fr (Postfix) with ESMTP id 9872F4B0052 for ; Sat, 14 Nov 2009 10:07:27 +0100 (CET) Message-ID: <4AFE734F.2020605@free.fr> Date: Sat, 14 Nov 2009 10:07:27 +0100 From: cyrille free User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: Commons Users List Subject: Re: DBCP deadlock References: <7818B6A2-A7FD-4DB5-AF54-7DDDD478A10A@logemann.org> <4AFBCFB9.2040501@free.fr> <75914213-6D25-4414-AD25-B4DDC80BC3AA@logemann.org> <23A7C19C-0734-4A15-B207-F189574DBA2D@logemann.org> <4AFC068E.9010908@apache.org> <9F567EB0-2E9C-4533-B54F-96845A727481@logemann.org> <4AFC4256.60802@apache.org> <1DDFCD1B-35BC-484A-BDC3-F919FCCA7B07@logemann.org> <4AFC4DD0.60409@gmail.com> <4AFC62C2.3050703@marine.rutgers.edu> In-Reply-To: <4AFC62C2.3050703@marine.rutgers.edu> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Virus-Checked: Checked by ClamAV on apache.org Hi, you can also use system to monitor your connections: nice ps -ef|grep java => will give you your java pid nice watch -n 1 'netstat -a|grep ESTABLISH|grep your_app_pid' => will display your netstat every 1s. Regards, Cyrille Wm.A.Stafford a �crit : > Marc, > I used the following to track down a connection leak when using an > older version of DBCP. I have not used it with later versions but I > believe some of the DBCP methods seen here have been removed. This > method was called after each call to open() and we saw the number of > active connections just keep on growing. > > public static String getConnectionPoolInfo( Dao dao){ > BasicDataSource ds = dao.getDataSource() ; > String configInfo = "initialSize=" + ds.getInitialSize() + " > maxActive=" + ds.getMaxActive() + " maxIdle=" + ds.getMaxIdle() + " > minIdle=" + ds.getMinIdle() ; > return configInfo + "\nactive connections=" + > ds.getNumActive() + " idle connections=" + ds.getNumIdle() ; > } > > hope this helps, > -=beeky > > Marc Logemann wrote: >>>> >>>> But in my view, connection leak means, i am not closing SQL >>>> connections >>>> (apart form the fact that i checked this) but then these connections >>>> would be "in use" by the pool and also "in use" by the the server jobs >>>> that hold the connections. But thats not the case. >>> >>> The "server jobs" may have vanished entirely, resulting in the >>> connection wrappers that they checked out from the pool getting >>> *abandoned*. Unless and until these objects are returned to the pool >>> by executing close() on them, DBCP considers them active, in use. If >>> they are never returned, pool capacity is leaked. >> >> >> THen it would be interesseting to know who is killing the server jobs >> on the i5 (IBM) machine if not the pool itself. I am quite sure that >> the DB2 on the i5 is not deleting connection jobs because it cant >> know if they are still needed. If DBCP is killing them it should not >> think at the same time that they are active and wait for a close() call. >> >> In my view, a typical connection leak has plenty of connections on >> the DB side (and in the pool of course) which are open and which >> never get closed. This is a typical situation. >> >> I will replace DBCP with the other mentioned pool if pool1.4 doesnt >> solve it and if i really have a problem with closing connections and >> thus leaking, i would face the same problems with C3P0 too. >> >> BTW is there a log level which i can use where DBCP prints out how >> many connections he thinks are currently in use by the pool? I mean, >> this would be a valuable information for debugging. >> >> Marc >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org >> For additional commands, e-mail: user-help@commons.apache.org >> > > --------------------------------------------------------------------- > To unsubscribe, e-mail: user-unsubscribe@commons.apache.org > For additional commands, e-mail: user-help@commons.apache.org > --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@commons.apache.org For additional commands, e-mail: user-help@commons.apache.org