title: MySQL Communications link failure due to underlying exception
body: <p><br>
  I am facing such annoying problem,<br>
  running on Tomcat 6 and MySQL using TomcatJDBC Lib.<br></p>
  
  <pre><code>com.mysql.jdbc.CommunicationsException: 
  </code></pre>
  
  <p>Communications link failure due to underlying exception: </p>
  
  <pre><code>** BEGIN NESTED EXCEPTION ** 
  
  java.io.EOFException
  
  STACKTRACE:
  
  java.io.EOFException
      at com.mysql.jdbc.MysqlIO.readFully(MysqlIO.java:1934)
      at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:2380)
      at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2909)
      at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1600)
      at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1695)
      at com.mysql.jdbc.Connection.execSQL(Connection.java:3026)
      at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1137)
      at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1231)
  </code></pre>
  
  <p>After some time (20sh mins) this occurs, all connections to db seems to expire.<br></p>
  
  <pre><code>autoReconnect=true" 
  validationQuery="Select 1"
  </code></pre>
  
  <p>Everything is set.<br>
  I do handle reconnect to database, and it works fine, but huge log files are bad, i cant either handle this exception to make it silent. Also this type of "fixing" isn't right solution. Is there any way to:<br>
  a) Handle this exception silently<br>
  b) Fix this issue (i do not have any firewall that i know of) (dont have access to my.cnf for mysql configuration) <br></p>
  
  <p>Also having this problem on Tomcat 5 with Apache jConnector on totaly different application, without any firewalls that could drop a connection.<br><br>
  <em>(Catching EOFException or CommunicationsException on method that does invoke connection doesn't help of course.)</em><br></p>
  
  <p>Thanks in advance.</p>