Sometimes I seem to lose connection to my mysql-database and then a connection is thrown and the program stops executing as it is now. I would like to try to reconnect to the database lets say 5 times more with a sleep() of 10 seconds in between to see if I can get the connection back. Which I guess will almost always be the case.
Is there some functionality for this in spring, like a reconnect() function somewhere or what would be the best way to accomplish this?
Not sure why the connection drops in the first case but may be some mysql-problem.
Any help would be appreciated.