We're updating the issue view to help you get more done. 

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

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

Environment

Hibernate version - 5.2.4
Oracle DB 12c
dialect used - org.hibernate.dialect.Oracle10gDialect

Status

Assignee

Andrea Boriero

Reporter

Pankaj Kr

Fix versions

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Worked in

4.3.1

Components

Affects versions

5.2.4

Priority

Critical