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
<property name="driverClassName" value="oracle.jdbc.OracleDriver"/>
<property name="url"
value="jdbc:oracle:thin:@10.70.193.1:1521:ora10g"/>
<property name="username" value="yh"/>
<property name="password" value="yh"/>
<property name="initialSize" value="9"/>
<property name="maxActive" value="18"/>
<property name="maxIdle" value="6"/>
<property name="minIdle" value="2"/>
<property name="maxWait" value="2000"/>
<property name="validationQuery" value="select 1 from dual"/>
<property name="testWhileIdle" value="true"/>
<property name="testOnBorrow" value="false"/>
<property name="testOnReturn" value="false"/>
<property name="timeBetweenEvictionRunsMillis" value="3000"/>
<property name="numTestsPerEvictionRun" value="2"/>
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