0

We are having hard time figuring out the properties defined, minIdle, maxIdle etc.

we are seeing the following error with the following setting

InitialSize=5
maxActive=50
maxIdle=40
maxWait=2000
Caused by: org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot get a connection, pool error Timeout waiting for idle object
    at org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:80)
    at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:1001)
    at org.springframework.jdbc.core.JdbcTemplate.call(JdbcTemplate.java:1064)

    ... 36 more
Caused by: 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 org.springframework.jdbc.datasource.lookup.AbstractRoutingDataSource.getConnection(AbstractRoutingDataSource.java:148)
    at org.springframework.jdbc.datasource.DataSourceUtils.doGetConnection(DataSourceUtils.java:111)
    at org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:77)
    ... 39 more
Caused by: java.util.NoSuchElementException: Timeout waiting for idle object
    at org.apache.commons.pool.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:1134)
    at org.apache.commons.dbcp.PoolingDataSource.getConnection(PoolingDataSource.java:106)
skaffman
  • 398,947
  • 96
  • 818
  • 769
Java Guy
  • 3,391
  • 14
  • 49
  • 55
  • When you get this error, how many connections has the pool created, and how many are active? How long are they active? – Jim Barrows May 03 '12 at 23:26

1 Answers1

2

This is resolved. The issue was connection leak from the bad application code. The application code was written to access the underlying native connection to use Oracle Array Types and not managed properly. Changed the code to using SimpleNativeJdbcExtractor

http://static.springsource.org/spring/docs/2.0.x/api/org/springframework/jdbc/support/nativejdbc/SimpleNativeJdbcExtractor.html

Java Guy
  • 3,391
  • 14
  • 49
  • 55