Return-Path: Delivered-To: apmail-commons-user-archive@www.apache.org Received: (qmail 70934 invoked from network); 26 Apr 2008 15:49:34 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 26 Apr 2008 15:49:34 -0000 Received: (qmail 61750 invoked by uid 500); 26 Apr 2008 15:49:29 -0000 Delivered-To: apmail-commons-user-archive@commons.apache.org Received: (qmail 61692 invoked by uid 500); 26 Apr 2008 15:49:28 -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 61681 invoked by uid 99); 26 Apr 2008 15:49:28 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 26 Apr 2008 08:49:28 -0700 X-ASF-Spam-Status: No, hits=2.0 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of hanson.char@gmail.com designates 74.125.46.153 as permitted sender) Received: from [74.125.46.153] (HELO yw-out-1718.google.com) (74.125.46.153) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 26 Apr 2008 15:48:44 +0000 Received: by yw-out-1718.google.com with SMTP id 9so1780525ywk.60 for ; Sat, 26 Apr 2008 08:48:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; bh=Hw5FRp/rtsLLxSQ1+a1EJ0zwP7hORsTEnN2dDyezJxU=; b=nNjFPnp1zdGvQYlMHNjrgvrlBzeBbZVQ3VlEyEZuA94w0mWL1wI/RqxKuY3UYA7Ka+80+a/HFP0XPIGROZqG1PLRS/1+WeEuOGDhjlEzrhSiAmqfkjUC0shpCvQm6vQA3Ghi5xXE4e7gZtYnVPLWwWjixOxEBuXLI58W1JsF5h8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=DETg5Ye6EK17KpukitfwxCLeKR6cqDIiA5S63vaYL+g5iYv2JgTVD5ghXIiClzyTLDaYN3Q0X7pT7OuWpi6dYbvIt77/X4YV2GYW4wftg8Xy5Mud3MEoCRDn5TPFaiWxk/dihAzxocSBsDXqMiMy/KQ0kNK4w97eGlf04lxJt9w= Received: by 10.150.82.41 with SMTP id f41mr1915896ybb.173.1209224930577; Sat, 26 Apr 2008 08:48:50 -0700 (PDT) Received: by 10.150.146.6 with HTTP; Sat, 26 Apr 2008 08:48:50 -0700 (PDT) Message-ID: Date: Sat, 26 Apr 2008 08:48:50 -0700 From: "Hanson Char" To: "Commons Users List" Subject: Re: [dbcp] Re: WAITING on lock=org.apache.commons.pool.impl.GenericObjectPool In-Reply-To: <4812FC7F.3050306@datatex.it> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_532_1018089.1209224930571" References: <48129318.1020901@datatex.it> <8a81b4af0804252325x589681g9f30a756f75a1c2c@mail.gmail.com> <4812FC7F.3050306@datatex.it> X-Virus-Checked: Checked by ClamAV on apache.org ------=_Part_532_1018089.1209224930571 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline >Is it possible that the connections are not returned to the pool after being closed? Or is it possible that the connections are never been closed from you application ? Hanson On Sat, Apr 26, 2008 at 2:57 AM, Philip Arad wrote: > Hi > > Thanks for your help. > You are right, I am using commons-pool-1.4.jar. > First I have setup the numbers of concurrent threads to 8, an ran the > program > several times. It is executing correctly. > > Then I have setup the following attributes on BasicDataSource: > vBDS.setMaxActive(400); > vBDS.setMinIdle(0); > vBDS.setMaxWait(3000L); > And set up the numbers of concurrent threads to 10. > After running it again, I had to same problem. > It seems like the setting of the attributes did not effect the > configuration > of the BasicDataSource. > Are there any parameters to setup on the PoolingDataSource? > Is it possible that the connections are not returned to the pool after > being > closed? > > Regards > Philip > > > > Philip > > > Phil Steitz wrote: > > > On Fri, Apr 25, 2008 at 7:27 PM, Philip Arad > > wrote: > > > > > > > Hi > > > > > > I am using commons-pool-1.3.jar with commons-dbcp-1.2.2.jar. > > > > > > > > > > Stack trace looks like pool 1.4, which is the latest release. > > > > > > > > > My program is using concurrent threads that each of them access the > > > DB > > > through > > > BasicDataSource. If I use 5 concurrent threads, the program is > > > running > > > without > > > any problem. The problem starts when I am using 10 threads: > > > Each thread is using the class ConnectionHelper to get a connection > > > to the > > > DB: > > > > > > > > > > > > > > > > > > > > > > > ------------------------------------------------------------------------------------ > > > "Thread-4" Id=14 in WAITING on > > > lock=org.apache.commons.pool.impl.GenericObjectPool@18a80d4 > > > at java.lang.Object.wait(Native Method) > > > at java.lang.Object.wait(Object.java:485) > > > at > > > > > > org.apache.commons.pool.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:942) > > > at > > > > > > org.apache.commons.dbcp.PoolingDataSource.getConnection(PoolingDataSource.java:96) > > > at > > > > > > dataAccess.util.ConnectionHelper.getConnection(ConnectionHelper.java:37) > > > - locked java.lang.Class@99d56b > > > at > > > > > > dataAccess.util.DataAccessLocalImpl.getConnection(DataAccessLocalImpl.java:25) > > > at > > > dataAccess.db.BaseDataAccess.getFullColumns(BaseDataAccess.java:1284) > > > at > > > dataAccess.db.BaseDataAccess.getFullColumns(BaseDataAccess.java:1272) > > > at > > > > > > dataAccess.util.CreateStatement.createStatement(CreateStatement.java:63) > > > at dataAccess.util.CreateStatement.process(CreateStatement.java:48) > > > at > > > > > > dataAccess.db.thread.query.QueryRunnerThread.run(QueryRunnerThread.java:19) > > > > > > > > > ------------------------------------------------------------------------------------ > > > > > > Can you tell me what should I do to solve this problem? > > > > > > > > > > The thread above is waiting for a connection to become available. The > > default maxActive setting of BasicDataSource is 8, so if you want to > > have more than 8 connections concurrently in use, you need to increase > > this. See the BasicDataSource javadoc. See also the maxWait > > property if you would prefer getConnection to time out and throw an > > exception when there are no idle connections available. > > > > Phil > > > > --------------------------------------------------------------------- > > 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 > > ------=_Part_532_1018089.1209224930571--