-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Martin,
Martin wrote: | I see autoReconnect functionality in mysql-connector-java-5.1.6.tar.gz | driver distro located at | http://ftp.plusline.de/mysql/Downloads/Connector-J/ Why not go to the canonical source? http://dev.mysql.com/doc/refman/5.0/en/connector-j-reference-configuration-properties.html The autoReconnect feature has been in the driver since 1.1 (before it was known as Connector/J). | I dont see autoreconnect supported in | mysql-connector-java-3.0.15-ga-bin.jar | $MYSQL_HOME/mysql-connector-3.0.15-GA>grep -S -l autoreconnect *.* | http://drc-dev.ohiolink.edu/browser/fedora-core/trunk/lib/mysql-connector-java-3.0.15-ga-bin.jar?rev=56 | here is the testcase which extercises the 5.1.6 functionality: | Properties props = new Driver().parseURL(BaseTestCase.dbUrl, null); | props.setProperty("autoReconnect", "true"); | | | | FWIW | Martin- | ----- Original Message ----- From: "Christopher Schultz" | <[EMAIL PROTECTED]> | To: "Tomcat Users List" <users@tomcat.apache.org> | Sent: Saturday, June 21, 2008 11:33 AM | Subject: Re: Tomcat Connection Pooling - wait_timeout | | | Thomas, | | Thomas Haines wrote: | | mysql connector 5.1.6 | | Is that a pre-release version, or did 5.1 become GA recently? | | | ERROR (21-06-08 07:59) [servlets.ViewEmail] | | com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: The last | packet | | successfully received from the server was 46859 seconds ago.The last | | packet sent successfully to the server was 46859 seconds ago, which is | | longer than the server configured value of 'wait_timeout'. You should | | consider either expiring and/or testing connection validity before use | | in your application, increasing the server configured values for client | | timeouts, or using the Connector/J connection property | | 'autoReconnect=true' to avoid this problem. | | That's strange... the error message says "use autoReconnect" but the | driver documentation says "don't use autoReconnect anymore". In either | case, you're better off setting a "validationQuery" attribute in your | <Resource> that can check for good connections (like 'SELECT 1'). | | | a) downgrade to MySQL Connector/J 5.0.8 and see if this fixes it; | | This may fix your problem, but probably not. The problem with | autoReconnect is that it doesn't fix your current connection for the | current query -- your first post-disconnect query will fail, and then | the next one will succeed. | | | b) add a while (!verified && attempts<2) type loop in getConnection() | | method to query the DB using a minimal query and then catch the first | | dead connection. | | Using 'validationQuery' achieves the same goal without modifying your | code (which is always nice). | | | I'm not overly keen on introducing the additional overhead of querying | | the DB just to check if it is valid every time a request is made for a | | connection. Does anyone have any thoughts on how I might debug/solve | | this issue? | | I think your options are to use a validationQuery (like just about | everyone else) or to create connections from scratch whenever you need | them. 'SELECT 1' overhead is very low. | | I seem to recall that newer versions of the MySQL driver could ping the | server or something like that to keep connections alive. Check the | documentation for your driver version to see if there's anything like | that. | | | I've searched widely on Google to no avail. Interestingly, | | there is another instance of tomcat communicating with MySQL on the | | machine, exactly the same configuration, that doesn't suffer these | | woes. | | What are the differences? Is it possible that the db connection just | never times out (because it gets light, regular traffic)? | | -chris |> - --------------------------------------------------------------------- To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] |> |> | --------------------------------------------------------------------- | To start a new topic, e-mail: users@tomcat.apache.org | To unsubscribe, e-mail: [EMAIL PROTECTED] | For additional commands, e-mail: [EMAIL PROTECTED] -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkhfvbYACgkQ9CaO5/Lv0PC2oACgpmvNzIJa/azxVqxOgo+hQGs2 LHYAn3kp4DpeTC2tq8oHXM4YM83/Ubuw =bnb9 -----END PGP SIGNATURE----- --------------------------------------------------------------------- To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]