james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Serge Knystautas <ser...@lokitech.com>
Subject Re: Mordred to DBCP
Date Mon, 21 Jul 2003 13:17:11 GMT
Danny Angus wrote:
> "select 1" should be ok for all db's, it is legitimate ANSI SQL.
> However I know you're looking at DBCP in commons, and suggest that you look
> at Connection.isClosed(), it then becomes the responsibility of the JDBC
> driver to check the connection. I don't know what different drivers do for
> this, but I seem to recal that mm.MySQL will test the connection, and expect
> that others will do so also, although the JDBC2 javadocs are vague "Tests to
> see if a Connection is closed" about whether this should physically test the
> connection or simply report whether close() has been called yet.

Normally I don't like doing this because of the extra round-trips, but 
especially in James, where we have a small set of SQL statements, the 
errors are going to be catastrophic and this kind of check is overkill. 
  I would bet with the SQL we have, these needless extra roundtrips 
would cause 20%+ degredation in performance.

This isn't really that hard though... when you do isClosed() or 
prepareStatement() on the connection and it throws an exception, **don't 
stick it back in the pool**.

Serge Knystautas
Lokitech >> software . strategy . design >> http://www.lokitech.com
p. 301.656.5501
e. sergek@lokitech.com

To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org

View raw message