title: Something wrong with Hibernate DB connection pooler c3p0
body: <p>since last post, did all the changes suggested but this problem still haunts me. Here's the error i get:</p>
  
  <pre><code>Caused by: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: The last packet successfully received from the server was 44,499,102 milliseconds ago.
  </code></pre>
  
  <p>here's my hibernate.cfg.xml</p>
  
  <pre><code>&lt;?xml version='1.0' encoding='utf-8'?&gt;
  &lt;!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD//EN" "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"&gt;
  
  &lt;hibernate-configuration&gt;
  &lt;session-factory&gt;
  
      &lt;property name="hibernate.connection.provider_class"&gt;org.hibernate.connection.C3P0ConnectionProvider&lt;/property&gt;        
      &lt;property name="hibernate.connection.driver_class"&gt;com.mysql.jdbc.Driver&lt;/property&gt;        
      &lt;property name="connection.autoReconnect"&gt; true&lt;/property&gt;
      &lt;property name="connection.autoReconnectForPools"&gt;true&lt;/property&gt;
      &lt;property name="connection.is-connection-validation-required"&gt;true&lt;/property&gt;
  
      &lt;property name="hibernate.c3p0.acquire_increment"&gt;5&lt;/property&gt; 
      &lt;property name="hibernate.c3p0.max_size"&gt;150&lt;/property&gt;
      &lt;property name="hibernate.c3p0.max_statements"&gt;0&lt;/property&gt;
      &lt;property name="hibernate.c3p0.min_size"&gt;10&lt;/property&gt;
      &lt;property name="hibernate.c3p0.timeout"&gt;100&lt;/property&gt; &lt;!-- seconds --&gt; 
      &lt;property name="hibernate.c3p0.idle_test_period"&gt;30&lt;/property&gt; &lt;!-- seconds --&gt; 
  
      &lt;property name="hibernate.connection.url"&gt;jdbc:mysql://!secret!autoReconnect=true&lt;/property&gt;
      &lt;property name="hibernate.connection.username"&gt;!secret!&lt;/property&gt;
      &lt;property name="hibernate.connection.password"&gt;!secret!&lt;/property&gt;
  
  
      &lt;!-- &lt;property name="hibernate.connection.pool_size"&gt;10&lt;/property&gt; --&gt;
  
      &lt;property name="show_sql"&gt;true&lt;/property&gt;
      &lt;property name="dialect"&gt;org.hibernate.dialect.MySQLDialect&lt;/property&gt;
      &lt;property name="hibernate.hbm2ddl.auto"&gt;update&lt;/property&gt;
      &lt;property name="current_session_context_class"&gt;thread&lt;/property&gt;
  
      &lt;!-- Mapping files --&gt;
      &lt;mapping resource="mappings.hbm.xml"/&gt;
  &lt;/session-factory&gt;
  &lt;/hibernate-configuration&gt;
  </code></pre>
  
  <p>and c3p0.properties</p>
  
  <pre><code>c3p0.preferredTestQuery=select 1 from dual
  c3p0.maxConnectionAge=3600
  c3p0.testConnectionOnCheckin=true
  c3p0.testConnectionOnCheckout=true
  c3p0.acquireRetryDelay=1000
  c3p0.acquireRetryAttempts=30
  c3p0.breakAfterAcquireFailure=false
  c3p0.idleConnectionTestPeriod=100
  </code></pre>