Uploaded image for project: 'Red Hat Process Automation Manager'
  1. Red Hat Process Automation Manager
  2. RHPAM-4774

Schema validation exception when validating Spring Boot DDL Scripts for Oracle and PostgreSQL



    • False
    • None
    • False
    • CR1
    • +
    • ---
    • Reported by QE


      When running the validation of the Spring Boot DDL Scripts for Oracle and PostgreSQL using the hibernate.hbm2ddl.auto=validate there is a mismatch in the sequences which have increment other than 1, i.e. 50. This started happening after the H2 upgrade which needed an upgrade of Hibernate from 5.3.20.Final to 5.4.24.Final.

      The exception can be seen in the logs attached.

      With that upgrade, the validation was improved and it now correctly retrieves the increment from the DB, which in case of the BAM_TASK_ID_SEQ is 50, not 1. However, Hibernate registers these legacy sequence generators as having starting value 1 and increment 1 no matter what is actually defined in the annotation. This creates discrepancy between what is seen by Hibernate as metadata (increment 1) and what is defined in the database (increment 50). It seems that when using the legacy sequence generators the increment of 1 is always registered in the metadata, no matter what is defined in the annotation, thus failing the validation.

      With 5.3.20.Final it wasn't failing because the increment wasn't really fetched from the database, it was set to -1 all the time here.

      With 5.4.24.Final it is now properly retrieved from the database.

      Functionality-wise nothing seems to have changed, however, the validation on Oracle and PostgreSQL DBs will now fail if a user sets hibernate.hbm2ddl.auto=validate. Also, after RHPAM-2591 we have introduced a Spring Boot-specific DDL scripts for Oracle and PostgreSQL as there was a newer version of Hibernate used to mitigate RHPAM-2591 which was generating negative IDs as on Spring Boot, the hibernate.id.new_generator_mappings is true while on EE containers and for engines it is false.

      The failing test is the DDLScriptsTest.


        Issue Links



              gmunozfe@redhat.com Gonzalo Muñoz Fernández
              mmacik@redhat.com Marian Macik
              Gonzalo Muñoz Fernández Gonzalo Muñoz Fernández
              Gonzalo Muñoz Fernández Gonzalo Muñoz Fernández
              0 Vote for this issue
              2 Start watching this issue