Return-Path: X-Original-To: apmail-commons-issues-archive@minotaur.apache.org Delivered-To: apmail-commons-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 2060F1AFA for ; Tue, 19 Apr 2011 17:02:46 +0000 (UTC) Received: (qmail 43135 invoked by uid 500); 19 Apr 2011 17:02:45 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 43038 invoked by uid 500); 19 Apr 2011 17:02:44 -0000 Mailing-List: contact issues-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: issues@commons.apache.org Delivered-To: mailing list issues@commons.apache.org Received: (qmail 42877 invoked by uid 99); 19 Apr 2011 17:02:44 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 19 Apr 2011 17:02:44 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 19 Apr 2011 17:02:43 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id D9B8FA96BE for ; Tue, 19 Apr 2011 17:02:05 +0000 (UTC) Date: Tue, 19 Apr 2011 17:02:05 +0000 (UTC) From: "cauherk (JIRA)" To: issues@commons.apache.org Message-ID: <821905068.67577.1303232525888.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Created] (POOL-185) when continue kill all connection , Cannot get a connection. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 when continue kill all connection , Cannot get a connection. ------------------------------------------------------------- Key: POOL-185 URL: https://issues.apache.org/jira/browse/POOL-185 Project: Commons Pool Issue Type: Bug Affects Versions: 1.5.5 Environment: suse enterprise linux 11 (64 bit) jdk1.5.0_21 (32 bit) oracle 10.2.0.3(64 bit) commons-pool-1.5.5.jar commons-dbcp-1.3.jar configure Reporter: cauherk After program startup,continue kill all connection.Use oracle command "alter system kill session 'sid,#p'". Exception org.apache.commons.dbcp.SQLNestedException: Cannot get a connection, pool error Timeout waiting for idle object at org.apache.commons.dbcp.PoolingDataSource.getConnection(PoolingDataSource.java:114) at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:1044) at test.TestConn.aa(TestConn.java:18) at test.TestConn.main(TestConn.java:49) Caused by: java.util.NoSuchElementException: Timeout waiting for idle object at org.apache.commons.pool.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:1144) at org.apache.commons.dbcp.AbandonedObjectPool.borrowObject(AbandonedObjectPool.java:79) at org.apache.commons.dbcp.PoolingDataSource.getConnection(PoolingDataSource.java:106) ... 7 more java.sql.SQLException: Cannot get a connection, pool error Timeout waiting for idle object at test.TestConn.aa(TestConn.java:18) at test.TestConn.main(TestConn.java:49) I debug org.apache.commons.pool.impl.GenericObjectPool. public synchronized void evict() throws Exception { assertOpen(); if(!_pool.isEmpty()) { ... } // if !empty } but _pool.isEmpty() is always empty,can not run into. private synchronized int calculateDeficit(boolean incrementInternal) { int objectDeficit = getMinIdle() - getNumIdle(); if (_maxActive > 0) { int growLimit = Math.max(0, getMaxActive() - getNumActive() - getNumIdle() - _numInternalProcessing); objectDeficit = Math.min(objectDeficit, growLimit); } if (incrementInternal && objectDeficit >0) { _numInternalProcessing++; } return objectDeficit; } calculateDeficit method is always return 0. So program always throw exception. -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira