title: MySql timeouts - Should I set autoReconnect=true in Spring application?
body: <p>After periods of inactivity on my website (Using Spring 2.5 and MySql), I get the following error:</p>
  
  <p><code>org.springframework.dao.RecoverableDataAccessException: The last packet sent successfully to the server was 52,847,830 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.</code></p>
  
  <p>According to <a href="https://stackoverflow.com/questions/667289/why-does-autoreconnecttrue-not-seem-to-work">this question</a>, and the <a href="http://bugs.mysql.com/bug.php?id=5020" rel="nofollow noreferrer">linked bug</a>, I shouldn't just set autoReconnect=true.  Does this mean I have to catch this exception on any queries I do and then retry the transaction?  Should that logic be in the data access layer, or the model layer?  Is there an easy way to handle this instead of wrapping every single query to catch this?</p>