J'utilise Spring 3.0.2, Hibernate 3.5.0 et c3p0 0.9.1.2 et j'ai beaucoup d'erreurs quand il s'agit de récupérer des connexions et de valider des transactions. Voici ma configuration de C3P0:c3p0 problèmes de gestion de connexion
<bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource" destroy-method="close">
<property name="driverClass" value="${jdbc.driverClassName}"/>
<property name="jdbcUrl" value="${jdbc.url}"/>
<property name="properties">
<props>
<prop key="c3p0.acquireIncrement">5</prop>
<prop key="c3p0.maxIdleTime">30</prop>
<prop key="c3p0.idleConnectionTestPeriod">20</prop>
<prop key="c3p0.maxPoolSize">100</prop>
<prop key="c3p0.maxStatements">0</prop>
<prop key="c3p0.minPoolSize">1</prop>
<prop key="user">${jdbc.username}</prop>
<prop key="password">${jdbc.password}</prop>
</props>
</property>
</bean>
Jusqu'à récemment, je suis arrivé cette erreur assez souvent:
com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
Last packet sent to the server was 0 ms ago.
Récemment je reçois également:
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!
Toutes les suggestions?