commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Noel J. Bergman" <>
Subject RE: cvs commit: jakarta-commons/dbcp/src/java/org/apache/commons/dbcp
Date Wed, 27 Aug 2003 18:10:38 GMT
> Bugzilla Bug 22750: BasicDataSource always sets testOnBorrow if given
> a validation query

> Only enable TestOnBorrow when testOnReturn  & testWhileIdle are not set

Why is this a bug?  Just because a connection was valid when it was
returned, and just because it hasn’t YET been detected by the whileIdle
mechanish, does NOT mean that the connection is still valid when it is

I think that BasicDataSource should default to conservative behavior, and
let the user disable it, rather than the other way around.

If the user doesn’t want this behavior, let them disable it by calling
setTestOnBorrow.  The real bug is in that method.  The various methods that
cover the connectionPool configuration are only setting the local value.
They should also be calling the connectionPool method if connectionPool is
not null.

	--- Noel

View raw message