Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Once you have created the database, you need to configure you your Hibernate file (adjust database name and other properties), named configmanager.hibernate.xml, and place it available in your EPSOS_PROPS_PATH location.Heres an example of the hibernate properties file

In case you're using MySQL, to avoid a "portalb is temporarily unavailable" error message in the Portal due to MySQL's wait_timeout being exceeded (that is, no requests made during that time), you should use the following setup:

Code Block
languagehtml/xml
titleSample configmanager.hibernate.xml
<?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>
        <property name="hibernate.dialect">org.hibernate.dialect.MySQLDialect</property>
        <property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
        <property name="hibernate.connection.url">jdbc:mysql://databasehost:3306/epsos._properties?useUnicode=true&amp;characterEncoding=UTF-8&amp;useFastDateParsing=false</property>
        <property name="hibernate.connection.username">username</property>
        <property name="hibernate.connection.password">password</property>
         
        <!-- JDBCEcho connectionall poolexecuted (useSQL the built-in)to stdout -->
        <property name="connection.poolshow_sizesql">1<>yes</property>
        <property name="hibernate.hbm2ddl.auto">update</property>
  <!-- Enable Hibernate's automatic session context management -->
        <property name="current_session_contexthibernate.connection.provider_class">thread<>org.hibernate.connection.C3P0ConnectionProvider</property>
        <!-- Disable the second-level cache -->    <property name="hibernate.c3p0.min_size">1</property>
            <property name="cachehibernate.c3p0.provider_class">org.hibernate.cache.NoCacheProvider<max_size">50</property>
            <property name="hibernate.c3p0.timeout">7200</property>
        <!-- Echo all executed SQL to stdout -->    <property name="hibernate.c3p0.max_statements">50</property>
            <property name="hibernate.c3p0.validate">true</property>
        <property name="show_sql">yes</property>
	hibernate.c3p0.idle_test_period">30</property>
        <property name="hibernate.hbm2ddlc3p0.auto">update<preferredTestQuery">SELECT 1 FROM DUAL</property>
        <mapping class="eu.epsos.configmanager.database.model.Property"/>
    </session-factory>
</hibernate-configuration>

...