I have the c3p0 configuration for pool connections, but about 8 hours, the connections fail's, I configured like the manual of hibernate said when tomcat is used, in the page:
http://www.hibernate.org/114.html
and
http://www.hibernate.org/214.html
I have:
c3p0
mysql jConnectors: 3.1.13
autorecconnect.
the hibernate.cfg.xml is:
<property name="dialect">org.hibernate.dialect.MySQLDialect</property>
<property name="connection.url">jdbc:mysql://localhost:3306/db?autoReconnect=true</property>
<property name="connection.username">test</property>
<property name="connection.password">test</property>
<property name="connection.driver_class">com.mysql.jdbc.Driver</property>
<!-- Use the C3P0 connection pool. -->
<property name="c3p0.acquire_increment">1</property>
<property name="c3p0.idle_test_period">100</property> <!-- seconds -->
<property name="c3p0.max_size">100</property>
<property name="c3p0.max_statements">0</property>
<property name="c3p0.min_size">10</property>
<property name="c3p0.timeout">100</property>
<property name="c3p0.preferredTestQuery">SELECT 1</property>
<property name="c3p0.testConnectionOnCheckout">true</property>
<!-- Disable second-level cache. -->
<property name="cache.provider_class">org.hibernate.cache.NoCacheProvider</property>
<property name="cache.use_query_cache">false</property>
<property name="cache.use_minimal_puts">false</property>
<property name="max_fetch_depth">3</property>
<!-- Print SQL to stdout. -->
<property name="show_sql">false</property>
<property name="format_sql">false</property>
<!-- Bind the getCurrentSession() method to the thread. -->
<property name="current_session_context_class">thread</property>
<property name="hibernate.jdbc.use_scrollable_resultsets">false</property>
[b]Hibernate version:3.0
[b]Name and version of the database you are using: mysql 4.1
** BEGIN NESTED EXCEPTION **
java.net.SocketException
MESSAGE: Broken pipe
STACKTRACE:
java.net.SocketException: Broken pipe
at java.net.SocketOutputStream.socketWrite0(Native Method)
at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:92)
at java.net.SocketOutputStream.write(SocketOutputStream.java:136)
at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:66)
at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:124)
at com.mysql.jdbc.MysqlIO.send(MysqlIO.java:2616)
at com.mysql.jdbc.MysqlIO.send(MysqlIO.java:2547)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1512)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1622)
at com.mysql.jdbc.Connection.execSQL(Connection.java:2385)
at com.mysql.jdbc.Connection.execSQL(Connection.java:2306)
at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1877)
at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java: