Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-6521

JNDI options for hibernate in Oracle do not work

    XMLWordPrintable

    Details

    • Documentation:
      N/A
    • Documentation in Release Notes:
      N/A
    • Similar issues:

      Description

      The following 2 sections are in the hibernate.cfg.xml file for Oracle :

          <!--  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:@oyama.hhs.nl:1521:tstwiki</property>
          <property name="connection.username">xwiki</property>
          <property name="connection.password">zaq1_wsx</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"/>
          <!-- -->
      
          <!--  Oracle DataSource 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.datasource">java:/comp/env/jdbc/ictwiki</property>
          <property name="dialect">org.hibernate.dialect.Oracle10gDialect</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"/>
      

      The JDBC version works with Oracle AS 10.1.3 , the JNDI does not.
      The problem is that the 2 hibernate properties do not get applied, so we get:

      Caused by: java.sql.SQLException: setString can only process strings of less than 32766 chararacters
      

      The first section does work, so we had to switch back to JDBC without JNDI, to prevent some pages from crashing on saving.

        Attachments

          Activity

            People

            Assignee:
            vmassol Vincent Massol
            Reporter:
            vgerris Vincent Gerris
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Date of First Response: