0

I am using hibernate with mysql database. But I am getting an exception "Communication link failure" every morning.

This could be due to idle connection whole night which MYSql closes in morning.

So what could be the best way to solve this problem. Should I increase wait_timeout or write a service which pings server every few hours? Please suggest.

Neeraj
  • 1,776
  • 2
  • 16
  • 35
  • 2
    1) http://stackoverflow.com/questions/6865538/solving-a-communications-link-failure-with-jdbc-and-mysql 2) http://stackoverflow.com/questions/2121829/mysql-jdbc-communications-link-failure – Suresh Kamrushi Nov 24 '14 at 06:31
  • Thanks, I saw these posts, but there are too many solutions not able to identify what could be the best solution for this. In my case its for sure the inactive connection problem. – Neeraj Nov 24 '14 at 06:39
  • 1
    There may be many solutions but that is the whole point of the vote that each answer has. One has 83 and the next 2 ... – Neil Stockton Nov 24 '14 at 07:51
  • OK Thanks, I am going for ping server in every x hour so that the connection is alive. Right now it drops connections which are inactive for more than 8 hours. – Neeraj Nov 24 '14 at 10:29

0 Answers0