Re: After some Idle time Mysql Database losing connection with Application
Hi,
From the client side you can set the socket timeout using the connection property "socketTimeout" (http://dev.mysql.com/doc/connector-j/5.1/en/connector-j-reference-configuration-properties.html) or you can also turn the property "autoReconnect" on, but first consult the documentation for details and recommendations on this.
From the server side you can set the session/connection timeout with the server variable "wait_timeout" (http://dev.mysql.com/doc/refman/5.7/en/server-system-variables.html#sysvar_wait_timeout).
You can also change your code so that it doesn't rely on long term connections by implementing shorter client sessions, if possible, or use connection pooling to avoid dealing with this kind of issues.
Check all the alternatives out and choose the one that best suites you.
I hope that helps.
Subject
Written By
Posted
Re: After some Idle time Mysql Database losing connection with Application
May 06, 2016 10:45AM
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.