title: Connection pool expires silently in Tomcat 7 but autoReconnect=true doesn't fix it
body: <p>I have been getting these exceptions for a number of weeks with no solution...</p>
  
  <blockquote>
    <p>com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: 
    The last packet successfully received from the server was 179,695,604 milliseconds ago.  </p>
    
    <p>The last packet sent successfully to the server was 179,695,604 milliseconds ago. is longer than the server configured value of 'wait_timeout'. You should consider either expiring and/or testing connection validity before use in your application, increasing the server configured values for client timeouts, or using the Connector/J connection property 'autoReconnect=true' to avoid this problem</p>
  </blockquote>
  
  <p>So I have altered my application's Context.xml to have the <code>autoReconnect=true</code> tag set with my databases for connection pooling in Tomcat 7. I have even set <code>wait_timeout</code> to infinity in the context file. </p>
  
  <p>What am I missing? Is this a common problem? It seems to have a small amount of information around on the net, but when I follow these guides, the same thing happens the next day after a period of inactivity.</p>
  
  <p>The more I use the server, the less this happens. I think it is expiration of the pool connections but how can I stop them expiring if <code>wait_timeout</code> is failing? Any ideas on how to diagnose the problem or config files?</p>