Hi folk,
how to obtain the same as "jdbc:mysql:/localhost/mydb?
autoReconnect=true" with oracle jdbc driver? Assuming actually, even with MySql, using the autoReconnect parameter is not recommended (
http://www.theserverside.com/news/thread.tss?thread_id=24137#111947).
I don't use Hibernate connection pool but
DBCP (with
tomcat) and this not help:
"
<property name="connection.autoReconnect">true</property>": after 8 hours of inactivity I get "connection error" exception.
Can
c3p0 help?
<property name="c3p0.idle_test_period">100</property>
Is c3p0 really "enterprise ready"?
Here 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="TestSessionFactory">
<!-- Database connection settings -->
<!--
<property name="hibernate.connection.driver_class">
oracle.jdbc.driver.OracleDriver
</property>
<property name="hibernate.connection.password">tiger</property>
<property name="hibernate.connection.url">
jdbc:oracle:thin:@10.0.0.14:1521:orcl
</property>
<property name="hibernate.connection.username">scott</property>
-->
<property name="connection.datasource">
java:/comp/env/jdbc/SITIP
</property>
<!-- JDBC Connection pool -->
<!-- <property name="connection.pool_size">1</property> -->
<!-- SQL Dialect -->
<property name="hibernate.dialect">
org.hibernate.dialect.Oracle10gDialect
</property>
<!-- Echo alla executed sql to stdout -->
<property name="show_sql">true</property>
<property name="format_sql">true</property>
<property name="use_sql_comments">true</property>
<!-- Enable Hibernate's automatic session context management -->
<!-- Use thread-bound persistence context propagation, scoped to the transaction -->
<property name="current_session_context_class">thread</property>
<!-- ATTENZIONE: mettendo "create" le tabelle vengono CANCELLATE!!! -->
<!-- Drop and re-create the database schema on startup -->
<property name="hbm2ddl.auto">update</property>
<!-- Seguono gli XML associati alle entità del progetto -->
<mapping resource="entity_hbmxml/CcsUser.hbm.xml" />
<mapping resource="entity_hbmxml/CcsUserCategory.hbm.xml" />
<mapping resource="entity_hbmxml/CcsCompany.hbm.xml" />
<mapping resource="entity_hbmxml/CcsMessage.hbm.xml" />
<mapping resource="entity_hbmxml/CcsMessageCategory.hbm.xml" />
<mapping resource="entity_hbmxml/CcsHarbour.hbm.xml" />
<mapping resource="entity_hbmxml/CcsDocument.hbm.xml" />
<mapping resource="entity_hbmxml/CcsDocumentCategory.hbm.xml" />
</session-factory>
</hibernate-configuration>