I have a webapp that is running on amazon ec2 on tomcat with hibernate and rest, my mySQL is standalone instance through amazon rds.
Once i start my webapp - everything is working fine, but recently i configured daily backups on my database and then started seeing problems with my webapp connecting to mySQL.
Basically the problem is only happens if my webapp was started before i mysql instance was restarted(backed up). Then after mySQL restart for some reason any connections to it from my webapp are failing.
It all resolves once i restart my ec2 vm (It might resolve if i restart tomcat as well, but i haven't tried that)
How can i make sure my webapp gets connected back to the mysql after mysql restart?
This is what im getting written to my log:
21-May-2015 11:42:27.857 WARN [http-nio-8080-exec-2] org.hibernate.engine.jdbc.spi.SqlExceptionHelper.logExceptions SQL Error: 0, SQLState: 08S01
21-May-2015 11:42:27.857 ERROR [http-nio-8080-exec-2] org.hibernate.engine.jdbc.spi.SqlExceptionHelper.logExceptions Communications link failure
The last packet successfully received from the server was 200,187 milliseconds ago. The last packet sent successfully to the server was 0 milliseconds ago.
Any suggestions on what to dig into?