Return-Path: X-Original-To: apmail-commons-user-archive@www.apache.org Delivered-To: apmail-commons-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id C5C8510A04 for ; Sun, 29 Sep 2013 16:41:41 +0000 (UTC) Received: (qmail 4533 invoked by uid 500); 29 Sep 2013 16:41:38 -0000 Delivered-To: apmail-commons-user-archive@commons.apache.org Received: (qmail 4215 invoked by uid 500); 29 Sep 2013 16:41:38 -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 4207 invoked by uid 99); 29 Sep 2013 16:41:37 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 29 Sep 2013 16:41:37 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of phil.steitz@gmail.com designates 209.85.220.53 as permitted sender) Received: from [209.85.220.53] (HELO mail-pa0-f53.google.com) (209.85.220.53) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 29 Sep 2013 16:41:30 +0000 Received: by mail-pa0-f53.google.com with SMTP id kq14so4802794pab.26 for ; Sun, 29 Sep 2013 09:41:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; bh=47iFae28xuFC2t0etu6H12HqALZv2MCQJAb85jOdyBk=; b=E05oGJzEdi4b3tY4mO1OgWmtuT0tQsTdlrsFK4/BU+QWPafCdFG2B1Wkqs5aQijjDg MKT9X3EjS0VgSdU4t7LnYcac7vFTiloFPN/FJuKcPWaVC32F2YTQ+msR8AFB9UAk6xA4 fpS/0LrgZFTmmYsjhyzGQRPJUfdugmOIIGvQVZHpomjujanfaJB2nuTeJyxmsabEnB9E SwwWwR+35shfKyrWBAumsRHfl4sQqwV6b7fGug+wogSKIPirjae2KKRQKyKtckt1pfYd h0fLOhwyt+7C0xODktACgGHN2sJNA6mFeh4MO90vz+X60MtN5mli9RqdsadCo7RNVlPN i6MQ== X-Received: by 10.68.241.132 with SMTP id wi4mr18966828pbc.45.1380472869206; Sun, 29 Sep 2013 09:41:09 -0700 (PDT) Received: from [192.168.2.107] (ip72-208-109-243.ph.ph.cox.net. [72.208.109.243]) by mx.google.com with ESMTPSA id rv9sm18358588pbc.4.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 29 Sep 2013 09:41:08 -0700 (PDT) Message-ID: <52485825.7020502@gmail.com> Date: Sun, 29 Sep 2013 09:41:09 -0700 From: Phil Steitz User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:17.0) Gecko/20130801 Thunderbird/17.0.8 MIME-Version: 1.0 To: Commons Users List Subject: Re: [dbcp] GenericObjectPool.borrowObject: Timeout waiting for idle object References: In-Reply-To: Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit X-Virus-Checked: Checked by ClamAV on apache.org On 9/29/13 7:13 AM, Bosio Andrea wrote: > > Hello all, > > I�m getting the following exception, using commons-dbcp-1.4. > > Caused by: java.util.NoSuchElementException: Timeout waiting for > idle object > > at > org.apache.commons.pool.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:1144) > ~[commons-pool-1.5.5.jar:1.5.5] > > at > org.apache.commons.dbcp.PoolingDataSource.getConnection(PoolingDataSource.java:106) > ~[commons-dbcp-1.4.jar:1.4] > > ... 62 common frames omitted > > Connections are managed by spring. These are the dbcp config > parameters: > > poolPreparedStatements=true > > defaultAutoCommit=false > > driverClassName=oracle.jdbc.driver.OracleDriver > > validationQuery=select 0 from dual > > initialSize=1 > > maxActive=15 > > maxIdle=15 > > maxWait=60000 > > removeAbandoned=false > > removeAbandonedTimeout=300 > > On the database (oracle) I see no active connections when the > problem occurs, and sometimes a few inactive connections (5 > connections). > > I got an heap dump, and found that the ConnectionPool object > (instance of org.apache.commons.pool.impl.GenericObjectPool) > numActive variable value is 15, so I understand that the > connection pool thinks that there are 15 active connections. > > I can�t understand why this happen, because on the database there > aren�t so many connections. > > On the heap dump, another thing is strange: the ConnectionPool > object variable �pool�, which as far I understand is the list of > the connections managed by the pool, contains no element! > The most likely explanation for this is that connections checked out from the pool are being abandoned by client threads - i.e., never returned via the close() method. The first thing to check is that on all code execution paths (including exceptions), the connections borrowed from the pool are being closed. You can turn on abandoned connection removal and logging to verify that this is not happening. If turning on abandoned connection removal makes the problem go away, you should still find and fix the code paths that abandon connections. Unless client threads are being interrupted, this will not likely fix anything, but you can try upgrading to version 1.5.7 of Commons Pool. Phil > > Bye, > Andrea > > > > Andrea Bosio > Manager > > Technology Reply > Via Cardinal Massaia, 71 > 10147 - Torino - ITALY > phone: +39 011 29100 > mobile: +39 348 9504513 > a.bosio@reply.it > www.reply.it > > Technology Reply > > > -------------------------------------------------------------------- > > -- > The information transmitted is intended for the person or entity > to which it is addressed and may contain confidential and/or > privileged material. Any review, retransmission, dissemination or > other use of, or taking of any action in reliance upon, this > information by persons or entities other than the intended > recipient is prohibited. If you received this in error, please > contact the sender and delete the material from any computer. --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@commons.apache.org For additional commands, e-mail: user-help@commons.apache.org