commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From manish ramteke <manish.s.ramt...@gmail.com>
Subject DBCP 1.4 : null returned by PoolingDataSource's getConnection()
Date Fri, 15 Apr 2016 05:43:16 GMT
Hi,

I am using DBCP 1.4, and facing below behavior on high traffic (40-50 tps)
on server despite of sufficient value for max connection pool size 300. I
am using Oracle JDBC Driver 6.

When PoolingDataSource's tries to borrow connection from
GenericObjectPool's borrowObject() method using getConnection(), conn
 returns null.

Please let me know possible causes for this error scenario.

Code snippet :

public Connection getConnection() throws SQLException {
        try {
            Connection conn = (Connection)(_pool.borrowObject());
            if (conn != null) {
                conn = new PoolGuardConnectionWrapper(conn);
            }
            return conn;
        } catch(SQLException e) {
            throw e;
        } catch(NoSuchElementException e) {
            throw new SQLNestedException("Cannot get a connection, pool
error " + e.getMessage(), e);
        } catch(RuntimeException e) {
            throw e;
        } catch(Exception e) {
            throw new SQLNestedException("Cannot get a connection, general
error", e);
        }
    }



Thanks and Regards,
Manish

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message