Uploaded image for project: 'Hibernate ORM'
  1. HHH-11440

In hibernate 5.2.4 hbm2ddl.auto=validate does not work with oracle

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 5.2.4
    • Fix Version/s: 5.2.14, 5.1.13, 5.3.0.CR2
    • Component/s: hibernate-core
    • Environment:
      Hibernate version - 5.2.4
      Oracle DB 12c
      dialect used - org.hibernate.dialect.Oracle10gDialect
    • Bug Testcase Reminder (view):

      Bug reports should generally be accompanied by a test case!

    • Worked in:
    • Last commented by a user?:
      true
    • Sprint:

      Description

      Recently we upgraded from hibernate 4.3.1 to hibernate 5.2.4. By default hbm2ddl.auto property is set to validate in my project. With 4.3.1 this was working fine with mysql and oracle databases. version 5.2.4 works with mysql but with oracle validate fails with below error even through the table exists in database.

      org.hibernate.tool.schema.spi.SchemaManagementException: Schema-validation: missing table [jds_parent_recordset]

      When I set hbm2ddl.auto=update|create that also works fine. I have 11 tables in my schema and the below mentioned table is the first in alphabetical order. Initially I thought it's a dialect issue so I have tried with different oracle dialects but none works. I am using ojdb7.jar.

      I have gone throught the 5.2.4 source code also but not debugged it yet. But I am sure this exception is thrown from org.hibernate.tool.schema.internal.AbstractSchemaValidator#validateTable() method. Below is the code snippet

      protected void validateTable(Table table, TableInformation tableInformation, Metadata metadata, ExecutionOptions options, Dialect dialect) {
      if (tableInformation == null)

      { throw new SchemaManagementException(String.format("Schema-validation: missing table [%s]", table.getQualifiedTableName().toString())); }

      Another user has also reported similar issue in hibernate forums https://forum.hibernate.org/viewtopic.php?f=1&t=1043846

        Attachments

          Issue links

            Activity

              People

              • Votes:
                2 Vote for this issue
                Watchers:
                10 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - 32h
                  32h
                  Remaining:
                  Remaining Estimate - 32h
                  32h
                  Logged:
                  Time Spent - Not Specified
                  Not Specified