Date: 2004-08-19T07:23:05
   Editor: DieterLeber <[EMAIL PROTECTED]>
   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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to