Dieses Blog durchsuchen

Montag, 13. Juli 2020

Flyway spring.jpa.hibernate.ddl-auto=validate fails with Oracle synonyms

Using Flyway alongside with Hibernate is a nice matchmaker. Within one of the Spring Boot project I noticed that the flyway validate fails. Reason was a missing view. But looking deeper into the conf shows a synonym, which is handling the view. Doesn't appear within the dev env because the devs disabled the long running validate.

They got error messages like:

Schema-validation: missing table
Schema-validation: missing column

Easy to get rid of this within a spring boot app if you know how. Here is my thought on that:

spring.jpa.hibernate.ddl-auto=validate
spring.datasource.hikari.datasource-properties.includeSynonyms=true
spring.jpa.properties.hibernate.synonyms=true


will help Spring Boot to configure the hikari pool and the hibernate source to also use synonyms for the metadata exploration.
Take care to also add config for tomcat or any other pool, if you don't use the spring default hikari pool.