title: hibernate and c3p0 PooledConnection don't renew connection after database reboot
body: <p>I'm using hibernate with c3p0, and as soon as the database is restarted, the application is broken with this error:</p>
  
  <pre><code>[warn] [com.mchange.v2.c3p0.impl.NewPooledConnection] [c3p0] A PooledConnection that has already signalled a Connection error is still in use!
  [warn] [com.mchange.v2.c3p0.impl.NewPooledConnection] [c3p0] Another error has occurred [ java.sql.SQLRecoverableException: Closed Connection ] which will not be reported to listeners!: java.sql.SQLRecoverableException: Closed Connection
  </code></pre>
  
  <p>at <code>TypedQuery.getSingleResult()</code>.</p>
  
  <p>I have to restart the application to fix it.</p>
  
  <p>Yet, the <code>EntityManager</code> is a singleton Bean created this way:</p>
  
  <pre><code>LocalContainerEntityManagerFactoryBean entityManagerFactory = new LocalContainerEntityManagerFactoryBean();
  
  ComboPooledDataSource cpds = new ComboPooledDataSource();
  cpds.setDriverClass(driverClassName);
  cpds.setJdbcUrl(url);
  cpds.setUser(user);
  cpds.setPassword(password);
  cpds.setPreferredTestQuery("SELECT 1 FROM dual");
  cpds.setIdleConnectionTestPeriod(20);
  cpds.setInitialPoolSize(0);
  cpds.setMinPoolSize(0);
  cpds.setMaxPoolSize(20);
  cpds.setTestConnectionOnCheckin(true);
  
  entityManagerFactory.setDataSource(cpds);
  </code></pre>
  
  <p>I don't understand why the connections are never replaced by the pool after the reboot of the database.</p>
  
  <p>Would anyone know how if there is something wrong with the way I'm using c3p0 ?</p>