deprecated autoReconnect=true - what do the alternatives bring
"Ralf Hauser" <[email protected]> Mon, 13 Aug 2007 16:29:51 +0200
| Newsgroups | gmane.comp.db.mysql.java |
|---|---|
| Message-ID | <00cc01c7ddb6$69a22990$2801a8c0@AcerRalf> |
Mark, Since years you recommend not to just use "autoReconnect=true" but to be smarter. First hints are in http://dev.mysql.com/doc/refman/5.0/en/connector-j-reference-configuration-p roperties.html and http://dev.mysql.com/doc/refman/5.0/en/connector-j-usagenotes-j2ee.html A few questions: 1) you recommend to "deal with SQLExceptions", do you have any code-examples how you recommend to do this - a while loop until I finally get a working connection or a different exception? In my setup, I use both ssl protected remote jdbc's and regular local jdbc's and AFAICR, the exceptions I get are not necessarily identical? You suggest this also http://lists.mysql.com/java/8119 - what would be a generic approach to do this? I guess if I deal with the exceptions, testOnBorrow=true no longer makes sense? 2) How do you rate the "testWhileIdle" strategy? If I do that, shouldn't I add also "minIdle" to ensure that if an idle test fails, a new connection is added to the pool? If this is configured nicely, do you still think it is worthwhile to set testOnBorrow=true as long as my application doesn't have a 5*9 SLA? Also, I use the Jakarta commons-dbcp with BasicDataSource and see that in org.apache.commons.dbcp.datasources.InstanceKeyDataSource the "testWhileIdle" keyword is dealt with. But who really does the testing? Is that connector-j or dbcp? 3) The documentation also lists autoReconnectForPools. How does this fit into the picture if I have tomcat with dbcp and JNDI resources? http://lists.mysql.com/java/7774 Many thanks for any hints in advance! Ralf -- MySQL Java Mailing List For list archives: http://lists.mysql.com/java To unsubscribe: http://lists.mysql.com/[email protected]