We have a piece of software (webapp with Tomcat) that uses the Apache commons connection pool and has worked great for years. Last month I had to update the libraries due to an old error that we encountered. The bug was fixed in the latest version.
Shortly after deployment, we began to receive these messages. Of the thousands of connections, we would receive one day, several (up to 10, usually) would receive this error message. There was no real picture, except that sometimes they were grouped into small groups of 2-5.
I changed the settings in the pool to check the connection every time it was taken or put back into the pool (if it is found poorly, a new one is created instead), and the problem disappeared.
Have you updated your MySQL drum recently? It seems that there may be a new setting that was not used in our (albeit very old) bank.
I agree with BalusC to try other parameters in your config, for example, those that you switch to MySQL (in addition to the connection timeout).
If this failure is temporary, like mine, and not permanent, then you can use a simple try / catch and loop to continue trying until everything succeeds or uses the connection pool to handle this part for you.
Another random idea: I do not know what is happening, why you are trying to use a closed connection (which exception you get). Could you accidentally close the connection somewhere?
MBCook Jan 23 2018-10-23T00: 00Z
source share