Hello!
I have a problem with two of my application. The database connection is always being closed after some hours (about 6 hours). When I restart my applications they are working again. I have configured c3po. This is my hibernate.cfg.xml file:
Code:
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory name="">
<property name="hibernate.c3p0.min_size">5</property>
<property name="hibernate.c3p0.max_size">20</property>
<property name="hibernate.c3p0.timeout">300</property>
<property name="hibernate.c3p0.max_statements">50</property>
<property name="hibernate.c3p0.idle_test_period">3000</property>
<property name="connection.url">jdbc:mysql://localhost/Hermed</property>
<property name="connection.username">root</property>
<property name="connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="dialect">org.hibernate.dialect.MySQLDialect</property>
<property name="connection.password">ncc-2424d</property>
<property name="transaction.factory_class">org.hibernate.transaction.JDBCTransactionFactory</property>
<property name="hibernate.jdbc.batch_size">0</property>
<property name="hibernate.query.factory_class">org.hibernate.hql.classic.ClassicQueryTranslatorFactory</property>
<!-- thread is the short name for
org.hibernate.context.ThreadLocalSessionContext
and let Hibernate bind the session automatically to the thread
-->
<property name="current_session_context_class">thread</property>
<!-- this will show us all sql statements -->
<property name="hibernate.show_sql">true</property>
<!-- automatic creation of tables -->
<property name="hibernate.hbm2ddl.auto">update</property>
<!-- mapping files -->
<!-- new mapping files of dmisv21 -->
<mapping class="at.ac.uibk.dbis.hermed.core.patient.Patient" resource="at/ac/uibk/dbis/hermed/core/patient/Patient.hbm.xml"/>
<mapping class="at.ac.uibk.dbis.hermed.core.medicine.Medicine" resource="at/ac/uibk/dbis/hermed/core/medicine/Medicine.hbm.xml"/>
<mapping class="at.ac.uibk.dbis.hermed.core.insurance.Insurer" resource="at/ac/uibk/dbis/hermed/core/insurance/Insurer.hbm.xml"/>
<mapping class="at.ac.uibk.dbis.hermed.core.cdarepository.CdaDocument" resource="at/ac/uibk/dbis/hermed/core/cdarepository/CdaDocument.hbm.xml"/>
<mapping class="at.ac.uibk.dbis.hermed.core.templaterepository.Template" resource="at/ac/uibk/dbis/hermed/core/templaterepository/Template.hbm.xml"/>
</session-factory>
</hibernate-configuration>
I use hibernate3. Is there a possibility to check if 3cpo is working correctly?
Thanks,
Florian