Excepcion:com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
...
Caused by: java.net.SocketException: Broken pipe
I have already read a lot of question similar to this one. So, before declaring this question 'unworthy' let me clarify some things
My JDBC link is fully working.
max_connections
, which is 300, is never reachedMy specific questions are:
Thank you
A Broken pipe
message means that the other end closed the connection, possibly because of a wrong order of packets received, or because the state between client and server isn't synchronized or something like that. Perhaps there's a firewall between your application and the server that kills persistent connections? Or perhaps there was nothing going on the pipe (connection) for some time, and the server closed it? In any case, if you are using a connection pooling mechanism (you should!), it should be possible to delegate the handling of such situations to it.
Or, if you intend to always use MySQL, you can try to add failOverReadOnly=false&maxReconnects=10&autoReconnect=true
to your connection string. This is specific to the MySQL JDBC driver, so, I'd really advise you to configure your connection pooling mechanism to test the connections before delivering them to your application.