title: The last packet sent successfully to the server was > 70,400,003 milliseconds ago. is longer than the server configured
body: <p>I have below exception</p>
  
  <blockquote>
    <p>javax.persistence.PersistenceException: Exception [EclipseLink-4002]
    (Eclipse Persistence Services - 2.5.2.v20140319-9ad6abd):
    org.eclipse.persistence.exceptions.DatabaseException Internal
    Exception: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException:
    The last packet successfully received from the server was 70,400,002
    milliseconds ago. The last packet sent successfully to the server was
    70,400,003 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>I did some research and change persistance.xml to this</p>
  
  <p><strong>Latest</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;persistence version="2.1" xmlns="http://xmlns.jcp.org/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd"&gt;
    &lt;persistence-unit name="unicorn" transaction-type="RESOURCE_LOCAL"&gt;
      &lt;provider&gt;org.hibernate.ejb.HibernatePersistence&lt;/provider&gt;
      &lt;class&gt;com.rh.xxx&lt;/class&gt;
      &lt;properties&gt;
        &lt;property name="hibernate.connection.driver_class" value="com.mysql.jdbc.Driver"/&gt;
        &lt;property name="hibernate.dialect" value="org.hibernate.dialect.MySQLDialect"/&gt;
        &lt;property name="hibernate.connection.url" value="jdbc:mysql://xxx:3306/unicorndb?zeroDateTimeBehavior=convertToNull"/&gt;
        &lt;property name="hibernate.connection.password" value="xxx"/&gt;
        &lt;property name="hibernate.connection.username" value="student"/&gt;
        &lt;property name="hibernate.c3p0.max_size" value="100" /&gt;  &lt;!--max number of JDBC connections --&gt;
        &lt;property name="hibernate.c3p0.min_size" value="10" /&gt;   &lt;!--minimum number of JDBC connections--&gt;
        &lt;property name="hibernate.c3p0.idle_test_period" value="500" /&gt;
        &lt;property name="hibernate.c3p0.acquire_increment" value="1" /&gt;
      &lt;/properties&gt;
    &lt;/persistence-unit&gt;
  &lt;/persistence&gt;
  </code></pre>
  
  <p>Did the latest code looked correct?</p>
  
  <p>Any help would be appreciated</p>