Answer the question
In order to leave comments, you need to log in
Why can't hibernate autoconnect to mysql after a timeout?
Good afternoon!
After a certain downtime, my connection to mysql through hibernate falls off. These are the hibernate settings I use:
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE hibernate-configuration SYSTEM "http://www.hbernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="hibernate.connection.url">jdbc:mysql://hostname?useUnicode=true&characterEncoding=UTF-8</property>
<property name="hibernate.connection.username">username</property>
<property name="connection.password">password</property>
<property name="hibernate.dialect">org.hibernate.dialect.MySQL5Dialect</property>
<property name="hibernate.jdbc.batch_size">30</property>
<property name="hibernate.current_session_context_class">thread</property>
<property name="hibernate.c3p0.minPoolSize">5</property>
<property name="hibernate.c3p0.maxPoolSize">20</property>
<property name="hibernate.c3p0.timeout">180000</property>
<property name="hibernate.c3p0.max_statement">50</property>
<property name="connection.autoReconnect">true</property>
<property name="connection.autoReconnectForPools">true</property>
<property name="connection.is-connection-validation-required">true</property>
<mapping class="package.name.ClassName"/>
</session-factory>
</hibernate-configuration>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question