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

Invalid mapping with Oracle 11g and Hibernate 3.6

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Blocker
    • 3.3, 3.4-milestone-1, 3.2.1
    • 3.2, 3.3-rc-1
    • Storage
    • None
    • Windows Server 2008 R2 x64, Oracle Enterprise 11g
    • oracle
    • Unknown

    Description

      It seems that starting with the Hibernate upgrade after 3.1.1 (from Hibernate 3.2.6 to 3.6.7 Final) there is a incompatibility between Hibernate and Oracle. It seems that some Oracle constraints are violated or some wrong data types are used by Hibernate to create the database in Oracle.

      I tested 3.1.1 which uses Hibernate 3.2.6 and it works.
      But 3.2 and 3.3 RC1 (Hibernate 3.6.7 Final) don't work

      Steps to reproduce the issue:

      • Install Oracle DB, create user xwiki, grant all privileges to xwiki;
      • modify the hiernate.cfg.xml to point to the Oracle DB
      • put the Oracle JDBC driver in libs
      • Start the Wiki
      • You will get a stacktrace as in "Vanilla_first_run_error.txt" attached to the issue

      Workaround found:

      • rename the "xwiki.oracle.hbm.xml_MODIFIED" and "feeds.oracle.hbm.xml_MODIFIED" to "xwiki.oracle.hbm.xml" and "feeds.oracle.hbm.xml" (originally found in xwiki-platform-legacy-oldcore-3.3-rc-1) and put them in /WEB-INF/classes
      • you also might want to set logging to "debug" in logback.xml
      • below I have attached the original "xwiki.oracle.hbm.xml" and "feeds.oracle.hbm.xml" as along with the modified versions (that work) + also 2 diff files between the original and modified ones.
      • start the xwiki and check "Modified_first_run.txt" for the stack trace. The wiki starts, I am able to import the XAR, and I also briefly tested to see if I get any breakages. Note that with the files attached, I get a lot of console messages, indicating there might be other underlying issues, or maybe some logger leftovers left enabled.

      This might be similar or even identical to XWIKI-7107

      I have also attached some Jetty logs in different stages until it worked. You can see there Oracle complaining about data types which it doesn't like
      Also, see attached diffs and jetty logs to different stages to see different places where Oracle complained about data types.

      THE DIFF FILES ARE NOT PATCHES, they only illustrate a possible (but less probable) way to make it work. They come aiding a developer to fix the issue.

      Attachments

        1. feeds.oracle.hbm.xml
          4 kB
        2. feeds.oracle.hbm.xml_MODIFIED
          4 kB
        3. feeds.oracle.hbm.xml.diff
          1 kB
        4. jetty2.log
          28 kB
        5. jetty3.log
          28 kB
        6. jetty4.log
          150 kB
        7. jetty5.log
          129 kB
        8. jetty6.log
          5.56 MB
        9. logback.xml
          3 kB
        10. Modified_first_run.txt
          2.47 MB
        11. Vanilla_first_run_error
          20 kB
        12. xwiki.oracle.hbm.xml
          26 kB
        13. xwiki.oracle.hbm.xml_MODIFIED
          27 kB
        14. xwiki.oracle.hbm.xml.diff
          2 kB

        Issue Links

          Activity

            People

              vmassol Vincent Massol
              sorinello Sorin Burjan
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: