So is autoReconnectForPools a hack to use with autoReconnect? -----Original Message----- From: Mark Matthews [mailto:[EMAIL PROTECTED] Sent: 12 March 2004 17:11 To: Tomcat Users List Subject: Re: problem with mod_jk 1.2: error in action code
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Mike Curwen wrote: > when you specify the connection to mysql, are you including the > 'autoreconnect=true' parameter? If not, the connections will be closed > by mysql after (I think) 8 hrs. > I wish I could kill the 'autoReconnect' feature. You shouldn't be using it if you're using a connection pool :) Use the correct properties on your connection pool and you should be good to go. For example, setting 'timeBetweenEvictionRunsMillis' (set to some sensible number of milliseconds, I would suggest something around 5 minutes) and 'minEvictableIdleTimeMillis' (set to the number of milliseconds you have 'wait_timeout' set to on the server minus some %) should catch MySQL closing idle connections. Setting 'validationQuery' (set to 'SELECT 1') and 'testOnBorrow' or 'testOnReturn' should catch MySQL server restarts or general network flakiness. In any case, you should also see the new example in the troubleshooting section of the Connector/J docs that shows how your code can also detect whether a SQLException was caused by a lost connection, or some other error (section 4.4 under the following link): http://www.mysql.com/documentation/connector-j/index.html#id2803835 -Mark (the guy who wrote the 'autoReconnect' functionality, and now wishes he could remove it from the JDBC driver) - -- Mr. Mark Matthews MySQL AB, Software Development Manager, J2EE and Windows Platforms Office: +1 708 332 0507 www.mysql.com Meet the MySQL Team! April 14-16, 2004 http://www.mysql.com/uc2004/ -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.3 (MingW32) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org iD8DBQFAUe8FtvXNTca6JD8RAmpmAJ0Wq/1rT/Fcw40H4fB1/g8UmheonACbBYwU mpRzou4Jb2yXUsGSNooLCKs= =DW3u -----END PGP SIGNATURE----- --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] ________________________________________________________________________ This e-mail has been scanned for all viruses by Star Internet. The service is powered by MessageLabs. Note:__________________________________________________________________ This message is for the named person's use only. It may contain confidential, proprietary or legally privileged information. No confidentiality or privilege is waived or lost by any mistransmission. If you receive this message in error, please immediately delete it and all copies of it from your system, destroy any hard copies of it and notify the sender. You must not, directly or indirectly, use, disclose, distribute, print, or copy any part of this message if you are not the intended recipient. Jaguar Freight Services and any of its subsidiaries each reserve the right to monitor all e-mail communications through its networks. Any views expressed in this message are those of the individual sender, except where the message states otherwise and the sender is authorized to state them to be the views of any such entity. ________________________________________________________________________ This e-mail has been scanned for all viruses by Star Internet. The service is powered by MessageLabs.
