> > when you do isClosed() or prepareStatement() on the connection
> > and it throws an exception, **don't stick it back in the pool**.
> I prefer testing when idle, but don't have a good enough knowledge of DBCP
> to take this further ATM.
I need to test it, but the following ...
source = new BasicDataSource() {
protected synchronized javax.sql.DataSource
createDataSource()
throws SQLException {
if (dataSource != null) {
return (dataSource);
} else {
javax.sql.DataSource ds = super.createDataSource();
connectionPool.setTestOnBorrow(true);
connectionPool.setTestOnReturn(true);
// connectionPool.setTestWhileIdle(true);
return ds;
}
}
};
turns on testing when the connection is acquired and returned. I might also
try the idle check, but I haven't checked the internals to see how that is
parameterized.
--- Noel
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]