Hi, I am getting the "java.sql.SQLException: Connection is closed" now and then in my production system .i am using apache DBCP connection pooling to get the connection. The DBCP connection pooling settings in my code are as follows......
connectionPool = new GenericObjectPool(null); connectionPool.setMaxActive(-1); connectionPool.setMin Idle(3); connectionPool.setMaxIdle(Integer.parseInt(maxIdle)); connectionPool.se tTestOnBorrow(true); connectionPool.setMaxWait(3 * 60 * 1000); String validationQuery = "select * from tab where rownum < 5"; ConnectionFactory connectionFactory = new DriverManagerConnectionFactory(connectURI, userName, pwd); PoolableConnectionFactory poolableConnectionFactory = new PoolableConnectionFactory(connectionFactory, connectionPool, null, validationQuery, false, true); Class.forName("org.apache.commons.dbcp.PoolingDriver"); PoolingDriver driver = (PoolingDriver) DriverManager.getDriver("jdbc:apache:commons:dbcp:"); driver.registerPool("ecoi t", connectionPool); ..... and when create statement is called, sql exception will be thrown with the message Connection is Closed
Exception message is as follows..
java.sql.SQLException: Connection is closed.0: org.apache.commons.dbcp.DelegatingConnection.checkOpen(DelegatingConnection.jav a:274)1: org.apache.commons.dbcp.DelegatingConnection.createStatement(DelegatingConnecti on.java:199)2: ........... ................ I am unable to find the ROOT CAUSE of this issue since it is not reproduceble in Development environment...Could you please help me to figure out the ROOT CAUSE and when it happens.