commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From commons-...@jakarta.apache.org
Subject [Jakarta Commons Wiki] Updated: DBCP
Date Thu, 19 Aug 2004 14:23:05 GMT
   Date: 2004-08-19T07:23:05
   Editor: DieterLeber <dieter.leber@ndsatcom.com>
   Wiki: Jakarta Commons Wiki
   Page: DBCP
   URL: http://wiki.apache.org/jakarta-commons/DBCP

   no comment

Change Log:

------------------------------------------------------------------------------
@@ -89,3 +89,13 @@
 
 A: They were replaced:
 http://cvs.apache.org/viewcvs.cgi/jakarta-commons/dbcp/src/java/org/apache/commons/dbcp/PoolableConnectionFactory.java?r1=1.22&r2=1.23&diff_format=h
+
+----
+
+Q: Without using validation of connections (testOnBorrow = false, testOnReturn = false, timeBetweenEvictionRunsMillis
= -1) and after shutdown and restarting the database again, it looks like the pool is cleaning
its old connections by itself. So it turns out that we always have valid connections. How
can you explain this and when is explicit validation necessary?
+
+A: During the connection activation (when borrowing a connection) the setAutoCommit and other
connection init methods are called. If one of these methods throws a SQLException then the
connection is also considered broken and removed from the pool.
+
+So if you are using one of the "default*" properties and the JDBC driver correctly reports
the SQLExceptions on the "set*" methods then you don't need an extra validationQuery.
+
+

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


Mime
View raw message