Re: Error rebooting my Database Service
Posted by: Todd Farmer
Date: May 08, 2013 09:31AM


When you reboot the MySQL database, the connections established die. But the client side gets no notification that the server (or the connections associated with it) died, so the next time you try to use one of those dead connections, it will report the CommunicationException error you describe. With autoReconnect=true, the Connection will attempt to re-establish a connection to MySQL when the CommunicationException is seen, but it will still - ALWAYS - throw the original CommunicationException to the client. I explain why here:

In short, you can revise your maintenance procedures to stop your application, then the MySQL service, then restart MySQL, and finally your application - this will ensure that your application doesn't have connections that were created before MySQL was brought down. Alternatively, you may be able to flush all existing connections (depending on your application architecture) after the MySQL server is rebooted. You can also implement connection validition checks or try/retry logic in your application.

I hope that helps.

Todd Farmer
MySQL @ Oracle

Options: ReplyQuote

Written By
Re: Error rebooting my Database Service
May 08, 2013 09:31AM

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.