commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tra...@spaceprogram.com
Subject [DBCP] Strange Problems and Errors
Date Tue, 01 Apr 2003 20:51:19 GMT
Ok, I'm getting some strange behaviour with dbcp as detailed below: 

Here is the config for it: 

connectionPool = new GenericObjectPool(null); 
       connectionPool.setMaxActive(50); 
        
       connectionPool.setWhenExhaustedAction(GenericObjectPool.WHEN_EXHAUSTED_GROW); 
       connectionPool.setMaxIdle(50); 
       connectionPool.setNumTestsPerEvictionRun(5); 
       connectionPool.setTestWhileIdle(true); 
       connectionPool.setTimeBetweenEvictionRunsMillis(20000); 
       connectionPool.setTestOnBorrow(true); 
       connectionPool.setTestOnReturn(false); 
       connectionPool.setMinEvictableIdleTimeMillis(-1); 

       DriverManagerConnectionFactory connectionFactory = new DriverManagerConnectionFactory(dbUrl,
props); 
       PoolableConnectionFactory poolableConnectionFactory = new PoolableConnectionFactory(connectionFactory,connectionPool,null,null,false,true);

       pool = new PoolingDataSource(connectionPool); 


And I am getting this error every couple of minutes: 

java.lang.NullPointerException 
       at com.mysql.jdbc.Connection.execSQL(Unknown Source) 
       at com.mysql.jdbc.Connection.execSQL(Unknown Source) 
       at com.mysql.jdbc.Connection.setAutoCommit(Unknown Source) 
       at org.apache.commons.dbcp.DelegatingConnection.setAutoCommit(DelegatingConnection.java:237)

       at org.apache.commons.dbcp.PoolableConnectionFactory.activateObject(PoolableConnectionFactory.java$

       at org.apache.commons.pool.impl.GenericObjectPool.borrowObject(Unknown Source) 
       at org.apache.commons.dbcp.PoolingDataSource.getConnection(PoolingDataSource.java:110)



Also, when I check pool.getNumActive(); it returns: -7580 . 

Idle looks alright though.  Any help would be appreciated cuase it seems that every so often,
users are getitng this error (== bad), then you refresh and the error is gone.   

Thanks in advance 

Travis Reeder 
Space Program 
http://www.spaceprogram.com 


Mime
View raw message