hibernate.cfg.xml.in 6.95 KB
Newer Older
Łukasz Nowak's avatar
Łukasz Nowak committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD//EN"
  "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
  <session-factory>

    <!-- Please refer to the installation guide on
         http://platform.xwiki.org/xwiki/bin/view/AdminGuide/Installation for configuring your
         database. You'll need to do 2 things:
         1) Copy your database driver JAR in WEB-INF/lib or in some shared lib directory
         2) Uncomment the properties below for your specific DB (and comment the default 
            database configuration if it doesn't match your DB)
    -->

    <!-- Generic parameters common to all Databases -->

    <property name="show_sql">false</property>
    <property name="use_outer_join">true</property>

    <property name="dbcp.defaultAutoCommit">false</property>
    <property name="dbcp.maxActive">50</property>
    <property name="dbcp.maxIdle">5</property>
    <property name="dbcp.maxWait">30000</property>
    <property name="dbcp.whenExhaustedAction">1</property>
    <property name="dbcp.ps.whenExhaustedAction">1</property>
    <property name="dbcp.ps.maxActive">20</property>
    <property name="dbcp.ps.maxWait">120000</property>
    <property name="dbcp.ps.maxIdle">20</property>
    <!-- Without it, some queries fail in MS SQL. XWiki doesn't need scrollable result sets, anyway. -->
    <property name="jdbc.use_scrollable_resultset">false</property>

    <!-- Configuration for the default database.
         Comment out this section and uncomment other sections below if you want to use another database.
         Note that the database tables will be created automatically if they don't already exist.
    <property name="connection.url">jdbc:hsqldb:file:database/xwiki_db;shutdown=true</property>
    <property name="connection.username">sa</property>
    <property name="connection.password"></property>
    <property name="connection.driver_class">org.hsqldb.jdbcDriver</property>
    <property name="dialect">org.hibernate.dialect.HSQLDialect</property>
    <property name="connection.provider_class">com.xpn.xwiki.store.DBCPConnectionProvider</property>
    <property name="connection.pool_size">2</property>
    <property name="statement_cache.size">2</property>
    <mapping resource="xwiki.hbm.xml"/>
    <mapping resource="feeds.hbm.xml"/>
    <mapping resource="activitystream.hbm.xml"/>
    -->
    
    <!-- MySQL configuration.
         Uncomment if you want to use MySQL and comment out other database configurations.
         We need to set the sql_mode to a less strict value, see XWIKI-1945
    -->
Cédric de Saint Martin's avatar
Cédric de Saint Martin committed
52
    <property name="connection.url">jdbc:mysql://%(mysql_ip)s:%(mysql_port)s/xwiki?useServerPrepStmts=false&amp;useUnicode=true&amp;characterEncoding=UTF-8&amp;sessionVariables=&amp;sql_mode=''</property>
Łukasz Nowak's avatar
Łukasz Nowak committed
53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128
    <property name="connection.username">xwiki</property>
    <property name="connection.password">xwiki</property>
    <property name="connection.driver_class">com.mysql.jdbc.Driver</property>
    <property name="dialect">org.hibernate.dialect.MySQLDialect</property>
    <property name="connection.provider_class">com.xpn.xwiki.store.DBCPConnectionProvider</property>
    <property name="connection.pool_size">2</property>
    <property name="statement_cache.size">2</property>
    <mapping resource="xwiki.hbm.xml"/>
    <mapping resource="feeds.hbm.xml"/>
    <mapping resource="activitystream.hbm.xml"/>

    <!-- HSQLDB configuration.
         Uncomment if you want to use HSQLDB and comment out other database configurations.
    <property name="connection.url">jdbc:hsqldb:file:/some/path/xwikidb;shutdown=true</property>
    <property name="connection.username">sa</property>
    <property name="connection.password"></property>
    <property name="connection.driver_class">org.hsqldb.jdbcDriver</property>
    <property name="dialect">org.hibernate.dialect.HSQLDialect</property>
    <property name="connection.provider_class">com.xpn.xwiki.store.DBCPConnectionProvider</property>
    <property name="connection.pool_size">2</property>
    <property name="statement_cache.size">2</property>
    <mapping resource="xwiki.hbm.xml"/>
    <mapping resource="feeds.hbm.xml"/>
    <mapping resource="activitystream.hbm.xml"/>
    -->

    <!-- PostgreSQL configuration.
         Uncomment if you want to use PostgreSQL and comment out other database configurations.
    <property name="connection.url">jdbc:postgresql:xwiki</property>
    <property name="connection.username">xwiki</property>
    <property name="connection.password">xwiki</property>
    <property name="connection.driver_class">org.postgresql.Driver</property>
    <property name="dialect">org.hibernate.dialect.PostgreSQLDialect</property>
    <property name="connection.provider_class">com.xpn.xwiki.store.DBCPConnectionProvider</property>
    <property name="connection.pool_size">2</property>
    <property name="statement_cache.size">2</property>
    <mapping resource="xwiki.hbm.xml"/>
    <mapping resource="feeds.hbm.xml"/>
    <mapping resource="activitystream.hbm.xml"/>
    -->

    <!-- Oracle configuration.
         Uncomment if you want to use Oracle and comment out other database configurations.
         Note: the 2 properties named "hibernate.connection.SetBigStringTryClob" and
         "hibernate.jdbc.batch_size". They are required to tell Oracle to allow CLOBs larger than
         32K. 
    <property name="connection.url">jdbc:oracle:thin:@localhost:1521:XE</property>
    <property name="connection.username">xwiki</property>
    <property name="connection.password">xwiki</property>
    <property name="connection.driver_class">oracle.jdbc.driver.OracleDriver</property>
    <property name="dialect">org.hibernate.dialect.Oracle10gDialect</property>
    <property name="connection.provider_class">com.xpn.xwiki.store.DBCPConnectionProvider</property>
    <property name="connection.pool_size">2</property>
    <property name="statement_cache.size">2</property>
    <property name="hibernate.connection.SetBigStringTryClob">true</property>
    <property name="hibernate.jdbc.batch_size">0</property>
    <mapping resource="xwiki.oracle.hbm.xml"/>
    <mapping resource="feeds.oracle.hbm.xml"/>
    <mapping resource="activitystream.hbm.xml"/>
    -->

    <!-- Derby configuration.
         Uncomment if you want to use Derby and comment out other database configurations.
    <property name="connection.url">jdbc:derby:/some/path/xwikidb;create=true</property>
    <property name="connection.driver_class">org.apache.derby.jdbc.EmbeddedDriver</property>
    <property name="dialect">org.hibernate.dialect.DerbyDialect</property>
    <property name="connection.provider_class">com.xpn.xwiki.store.DBCPConnectionProvider</property>
    <property name="connection.pool_size">2</property>
    <property name="statement_cache.size">2</property>
    <mapping resource="xwiki.derby.hbm.xml"/>
    <mapping resource="feeds.hbm.xml"/>
    <mapping resource="activitystream.hbm.xml"/>
    -->

  </session-factory>
</hibernate-configuration>