Solution C3p0 Re: Communications link failure due to underlying exception (My Solution)
Posted by:
Richipal Singh ()
Date: April 01, 2007 04:10AM
I am using
java 1.5
hibernate 3
mysql 5
these settings worked for me I had the same problem, I have pasted the copy of hibernate.cfg.xml, might help someone.
<property name="connection.username">root</property>
<property name="connection.url">jdbc:mysql://localhost:3306/database?autoReconnect=true</property>
<property name="dialect">org.hibernate.dialect.MySQLDialect</property>
<property name="myeclipse.connection.profile">mysql</property>
<property name="connection.password">password</property>
<property name="connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="hibernate.c3p0.min_size">10</property>
<property name="hibernate.c3p0.max_size">100</property>
<property name="hibernate.c3p0.timeout">10</property>
<property name="hibernate.c3p0.acquireRetryAttempts">30</property>
<property name="hibernate.c3p0.acquireIncrement">5</property>
<property name="hibernate.c3p0.idleConnectionTestPeriod">300</property>
<property name="hibernate.c3p0.initialPoolSize">20</property>
<property name="hibernate.c3p0.maxPoolSize">100</property>
<property name="hibernate.c3p0.maxIdleTime">300</property>
<property name="hibernate.c3p0.maxStatements">50</property>
<property name="hibernate.c3p0.minPoolSize">10</property>