You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Cheng Xu <xu...@yahoo.com.sg> on 2003/06/02 08:45:12 UTC
Broken pipe despite validation query set
Hi All. I had a broken pipe problem with my Struts
application that is using DBCP. I have set my
validation query when creating the
oolableConnectionFactory, but it doesn't seems to
work.
The database is restarted everyday for backup
purpose.The application works fine for about 1 month
until last week I saw the first IOException: broken
pipe.
Some facts:
Using tomcat 4.1.24, Struts 1.1beta2, Oracle 8.1.7
JDBC. Driver is oracle.jdbc.driver.OracleDriver. The
validation query used is "select sysdate from dual".
Code snip:
try {
Driver oracleDriver = new
oracle.jdbc.driver.OracleDriver();
DriverManager.registerDriver(oracleDriver);
// Create an object pool for Connections
StackObjectPool connectionPool = new
StackObjectPool(maxIdleConnections, initConnections);
// Create a keyed object pool for Prepared
Statements
StackKeyedObjectPoolFactory
prepStmtPoolFactory = new
StackKeyedObjectPoolFactory(maxIdlePrepStmts,
initPrepStmts);
DriverManagerConnectionFactory
connectionFactory = new
DriverManagerConnectionFactory(dburi, username,
password);
PoolableConnectionFactory
poolableConnectionFactory =
new
PoolableConnectionFactory(connectionFactory,connectionPool,
prepStmtPoolFactory,"select sysdate from
dual",true,true);
PoolingDriver poolingDriver = new
PoolingDriver();
poolingDriver.registerPool(DATASOURCE_NAME,connectionPool);
log.trace("Pooling driver created and
registered");
Any idea why the validation query is not working?
Thanks.
__________________________________________________
Do You Yahoo!?
Send free SMS from your PC!
http://sg.sms.yahoo.com