Issues

Select view

Select search mode

 
17 of 17

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

Fixed

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

Attachments

1

Details

Assignee

Reporter

Worked in

Components

Priority

Created October 24, 2017 at 10:31 AM
Updated March 20, 2018 at 3:21 AM
Resolved March 20, 2018 at 2:28 AM

Activity

Former userMarch 20, 2018 at 2:28 AM

Fixed in 5.1 branch as well.

Matteo SteccoliniOctober 25, 2017 at 10:16 AM

, I upgraded to 5.1.10 and set that config value, and it seems to create and apply ddl for single alterations again, like it did by default in 5.1.3 (I don't know if this is the same behaviour or something somewhat different).

Andrea BorieroOctober 25, 2017 at 9:13 AM

, I'm not sure I have to check also if the issue has been resolved in 5.2.

can you try to set the following config value

Thanks

Former userOctober 24, 2017 at 9:29 PM

, will the fix for this issue include a fix for HHH-12057?

Flag notifications