title: c3p0 connection management problems
body: <p>I'm using Spring 3.0.2, Hibernate 3.5.0 and c3p0 0.9.1.2 and I'm having a ton of errors when it comes down to retrieving connections and commiting transactions. Here's my configuration of c3p0:</p>
  
  <pre><code>&lt;bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource" destroy-method="close"&gt;
      &lt;property name="driverClass" value="${jdbc.driverClassName}"/&gt;
      &lt;property name="jdbcUrl" value="${jdbc.url}"/&gt;
      &lt;property name="properties"&gt;
          &lt;props&gt;
              &lt;prop key="c3p0.acquireIncrement"&gt;5&lt;/prop&gt;
              &lt;prop key="c3p0.maxIdleTime"&gt;30&lt;/prop&gt;
              &lt;prop key="c3p0.idleConnectionTestPeriod"&gt;20&lt;/prop&gt;
              &lt;prop key="c3p0.maxPoolSize"&gt;100&lt;/prop&gt;
              &lt;prop key="c3p0.maxStatements"&gt;0&lt;/prop&gt;
              &lt;prop key="c3p0.minPoolSize"&gt;1&lt;/prop&gt;
              &lt;prop key="user"&gt;${jdbc.username}&lt;/prop&gt;
              &lt;prop key="password"&gt;${jdbc.password}&lt;/prop&gt;
          &lt;/props&gt;
      &lt;/property&gt;
  &lt;/bean&gt;
  </code></pre>
  
  <p>Up until recently I got this error pretty often:</p>
  
  <pre><code>com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
  Last packet sent to the server was 0 ms ago.
  </code></pre>
  
  <p>Recently I also get these:</p>
  
  <pre><code>com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Connection.close() has already been called. Invalid operation in this state.
  java.sql.SQLException: Connections could not be acquired from the underlying database!
  </code></pre>
  
  <p>Any suggestions?</p>