hibernate.hbm2ddl.auto=update stopped working in Oracle since 5.1.4

Description

I noticed that since version 5.1.4 the entities wouldn't be updated anymore (with hibernate.hbm2ddl.auto=update) when adding fields. It probably applies to Oracle and not to other database engines, because of HHH-11023.

I attach a test case which isn't exactly a test case, but you can see the difference between 5.1.3 and 5.1.4 in the logs and on the database.

It seems that entities are not updated but re-created instead (they exist and so re-creation fails):

Steps to reproduce

  1. If using my test case (not really a test case), create an Oracle schema and change persistence.xml accordingly

  2. Create an entity (for example IwillUpdate in my test case) with FIELD1.

  3. Launch the entityManager (for example in the JPAUnitTestCase).

  4. Verify that the table has been created with FIELD1

  5. Add a FIELD2 in the entity

  6. Launch the entityManager again

  7. Verify that you have a ORA-00604 error in the log and that the table hasn't changed (no FIELD2)

  8. change hibernate version to 5.1.3 in the pom.xml

  9. Launch the entityManager again

  10. Verify that no error is shown and that the table has been updated

Environment

hibernate 5.1.4 and later, JDK 1.7, Oracle 11.2.0.4.0 as database backend

Assignee

Andrea Boriero

Reporter

Matteo Steccolini

Fix versions

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Worked in

5.1.2
5.1.3

Components

Affects versions

Priority

Major
Configure