Guest User

Untitled

a guest
Mar 7th, 2014
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.02 KB | None | 0 0
  1. root@xwiki ~# cat /etc/xwiki/hibernate.cfg.xml
  2. <?xml version="1.0" encoding="UTF-8"?>
  3.  
  4. <!--
  5. * See the NOTICE file distributed with this work for additional
  6. * information regarding copyright ownership.
  7. *
  8. * This is free software; you can redistribute it and/or modify it
  9. * under the terms of the GNU Lesser General Public License as
  10. * published by the Free Software Foundation; either version 2.1 of
  11. * the License, or (at your option) any later version.
  12. *
  13. * This software is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  16. * Lesser General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU Lesser General Public
  19. * License along with this software; if not, write to the Free
  20. * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
  21. * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
  22. -->
  23.  
  24. <!DOCTYPE hibernate-configuration PUBLIC
  25. "-//Hibernate/Hibernate Configuration DTD//EN"
  26. "http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd">
  27. <hibernate-configuration>
  28. <session-factory>
  29.  
  30. <!-- Please refer to the installation guide on
  31. http://platform.xwiki.org/xwiki/bin/view/AdminGuide/Installation for configuring your
  32. database. You'll need to do 2 things:
  33. 1) Copy your database driver JAR in WEB-INF/lib or in some shared lib directory
  34. 2) Uncomment the properties below for your specific DB (and comment the default
  35. database configuration if it doesn't match your DB)
  36. -->
  37.  
  38. <!-- Generic parameters common to all Databases -->
  39.  
  40. <property name="show_sql">false</property>
  41. <property name="use_outer_join">true</property>
  42.  
  43. <property name="connection.pool_size">2</property>
  44. <property name="statement_cache.size">2</property>
  45.  
  46. <!-- Without it, some queries fail in MS SQL. XWiki doesn't need scrollable result sets, anyway. -->
  47. <property name="jdbc.use_scrollable_resultset">false</property>
  48.  
  49. <!-- DBCP Connection Pooling configuration
  50. -->
  51. <property name="dbcp.defaultAutoCommit">false</property>
  52. <property name="dbcp.maxActive">50</property>
  53. <property name="dbcp.maxIdle">5</property>
  54. <property name="dbcp.maxWait">30000</property>
  55. <property name="dbcp.whenExhaustedAction">1</property>
  56. <property name="dbcp.ps.whenExhaustedAction">1</property>
  57. <property name="dbcp.ps.maxWait">120000</property>
  58. <property name="dbcp.ps.maxIdle">20</property>
  59. <property name="connection.provider_class">com.xpn.xwiki.store.DBCPConnectionProvider</property>
  60.  
  61. <!-- Setting dbcp.ps.maxActive configuration tells DBCP whether to cache Prepared Statement or not.
  62.  
  63. Note 1: When using HSQLDB for example, it's important to NOT cache prepared statements because HSQLDB
  64. Prepared Statements (PS) contain the schema on which they were initially created and thus when switching
  65. schema if the same PS is reused it'll execute on the wrong schema! Since HSQLDB does internally cache
  66. prepared statement there's no performance loss. see http://jira.xwiki.org/browse/XWIKI-1740.
  67. Thus we recommend not turning on this configuration for HSQLDB unless you know what you're doing :)
  68.  
  69. Note 2: The same applies to PostGreSQL.
  70. -->
  71.  
  72. <!-- BoneCP Connection Pooling configuration.
  73. <property name="bonecp.idleMaxAgeInMinutes">240</property>
  74. <property name="bonecp.idleConnectionTestPeriodInMinutes">60</property>
  75. <property name="bonecp.partitionCount">3</property>
  76. <property name="bonecp.acquireIncrement">10</property>
  77. <property name="bonecp.maxConnectionsPerPartition">60</property>
  78. <property name="bonecp.minConnectionsPerPartition">20</property>
  79. <property name="bonecp.statementsCacheSize">50</property>
  80. <property name="bonecp.releaseHelperThreads">3</property>
  81. <property name="connection.provider_class">com.xpn.xwiki.store.DBCPConnectionProvider</property>
  82. -->
  83.  
  84.  
  85. <!-- Configuration for the default database.
  86. Comment out this section and uncomment other sections below if you want to use another database.
  87. Note that the database tables will be created automatically if they don't already exist.
  88. -->
  89. <property name="connection.url">jdbc:mysql://localhost/xwiki?useServerPrepStmts=false&amp;useUnicode=true&amp;characterEncoding=UTF-8</property>
  90. <property name="connection.username">xwiki</property>
  91. <property name="connection.password">tr@fo2014</property>
  92. <property name="connection.driver_class">com.mysql.jdbc.Driver</property>
  93. <property name="dialect">org.hibernate.dialect.MySQL5InnoDBDialect</property>
  94.  
  95. <mapping resource="xwiki.hbm.xml"/>
  96. <mapping resource="feeds.hbm.xml"/>
  97. <mapping resource="activitystream.hbm.xml"/>
  98. <mapping resource="instance.hbm.xml"/>
  99.  
  100. <!-- MySQL configuration.
  101. Uncomment if you want to use MySQL and comment out other database configurations.
  102.  
  103. <property name="connection.url">jdbc:mysql://localhost/xwiki</property>
  104. <property name="connection.username">xwiki</property>
  105. <property name="connection.password">xwiki</property>
  106. <property name="connection.driver_class">com.mysql.jdbc.Driver</property>
  107. <property name="dialect">org.hibernate.dialect.MySQL5InnoDBDialect</property>
  108. <property name="dbcp.ps.maxActive">20</property>
  109. <mapping resource="xwiki.hbm.xml"/>
  110. <mapping resource="feeds.hbm.xml"/>
  111. <mapping resource="activitystream.hbm.xml"/>
  112. <mapping resource="instance.hbm.xml"/>
  113. -->
  114.  
  115. <!-- HSQLDB configuration.
  116. Uncomment if you want to use HSQLDB and comment out other database configurations.
  117.  
  118. <property name="connection.url">jdbc:hsqldb:file:${environment.permanentDirectory}/database/xwiki_db;shutdown=true</property>
  119. <property name="connection.username">sa</property>
  120. <property name="connection.password"></property>
  121. <property name="connection.driver_class">org.hsqldb.jdbcDriver</property>
  122. <property name="dialect">org.hibernate.dialect.HSQLDialect</property>
  123. <mapping resource="xwiki.hbm.xml"/>
  124. <mapping resource="feeds.hbm.xml"/>
  125. <mapping resource="activitystream.hbm.xml"/>
  126. <mapping resource="instance.hbm.xml"/>
  127. -->
  128.  
  129. <!-- PostgreSQL configuration.
  130. Uncomment if you want to use PostgreSQL and comment out other database configurations.
  131. Notes:
  132. - "jdbc.use_streams_for_binary" needs to be set to "false",
  133. see https://community.jboss.org/wiki/HibernateCoreMigrationGuide36
  134. - "xwiki.virtual_mode" can be set to either "schema" or "database". Note that currently the database mode
  135. doesn't support database creation (see http://jira.xwiki.org/browse/XWIKI-8753)
  136.  
  137. <property name="connection.url">jdbc:postgresql:xwiki</property>
  138. <property name="connection.username">xwiki</property>
  139. <property name="connection.password">xwiki</property>
  140. <property name="connection.driver_class">org.postgresql.Driver</property>
  141. <property name="dialect">org.hibernate.dialect.PostgreSQLDialect</property>
  142. <property name="jdbc.use_streams_for_binary">false</property>
  143. <property name="xwiki.virtual_mode">schema</property>
  144. <mapping resource="xwiki.postgresql.hbm.xml"/>
  145. <mapping resource="feeds.hbm.xml"/>
  146. <mapping resource="activitystream.hbm.xml"/>
  147. <mapping resource="instance.hbm.xml"/>
  148. -->
  149.  
  150. <!-- Oracle configuration.
  151. Uncomment if you want to use Oracle and comment out other database configurations.
  152. Notes:
  153. - the 2 properties named "connection.SetBigStringTryClob" and
  154. "jdbc.batch_size". They are required to tell Oracle to allow CLOBs larger than 32K.
  155. - "jdbc.use_streams_for_binary" needs to be set to "false",
  156. see https://community.jboss.org/wiki/HibernateCoreMigrationGuide36
  157.  
  158. <property name="connection.url">jdbc:oracle:thin:@localhost:1521:XE</property>
  159. <property name="connection.username">xwiki</property>
  160. <property name="connection.password">xwiki</property>
  161. <property name="connection.driver_class">oracle.jdbc.driver.OracleDriver</property>
  162. <property name="dialect">org.hibernate.dialect.Oracle10gDialect</property>
  163. <property name="connection.SetBigStringTryClob">true</property>
  164. <property name="jdbc.batch_size">0</property>
  165. <property name="jdbc.use_streams_for_binary">false</property>
  166. <property name="dbcp.ps.maxActive">20</property>
  167. <mapping resource="xwiki.oracle.hbm.xml"/>
  168. <mapping resource="feeds.oracle.hbm.xml"/>
  169. <mapping resource="activitystream.hbm.xml"/>
  170. <mapping resource="instance.hbm.xml"/>
  171. -->
  172.  
  173. <!-- Derby configuration.
  174. Uncomment if you want to use Derby and comment out other database configurations.
  175.  
  176. <property name="connection.url">jdbc:derby:/some/path/xwikidb;create=true</property>
  177. <property name="connection.driver_class">org.apache.derby.jdbc.EmbeddedDriver</property>
  178. <property name="dialect">org.hibernate.dialect.DerbyDialect</property>
  179. <property name="dbcp.ps.maxActive">20</property>
  180. <mapping resource="xwiki.derby.hbm.xml"/>
  181. <mapping resource="feeds.hbm.xml"/>
  182. <mapping resource="activitystream.hbm.xml"/>
  183. <mapping resource="instance.hbm.xml"/>
  184. -->
  185.  
  186. <!-- H2 configuration.
  187. Uncomment if you want to use H2 and comment out other database configurations.
  188.  
  189. <property name="connection.url">jdbc:h2:${environment.permanentDirectory}/database/xwiki</property>
  190. <property name="connection.username">sa</property>
  191. <property name="connection.password"></property>
  192. <property name="connection.driver_class">org.h2.Driver</property>
  193. <property name="dialect">org.hibernate.dialect.H2Dialect</property>
  194. <mapping resource="xwiki.hbm.xml"/>
  195. <mapping resource="feeds.hbm.xml"/>
  196. <mapping resource="activitystream.hbm.xml"/>
  197. <mapping resource="instance.hbm.xml"/>
  198. -->
  199.  
  200. </session-factory>
  201. </hibernate-configuration>
Advertisement
Add Comment
Please, Sign In to add comment