james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Noel J. Bergman" <n...@devtech.com>
Subject RE: Mordred to DBCP
Date Mon, 21 Jul 2003 20:00:53 GMT
> > 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: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


Mime
View raw message