oasp / oasp4j

The Open Application Standard Platform for Java

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Spring boot upgrade issue for mysql

vapadwal opened this issue · comments

After springboot upgrade PR, I had run few tests for mysql,postgres and oracle, below are the findings:

For MySql,

After the upgrade of Spring boot 2, Hibernate version has been upgraded to 5.3.x . In this version of hibernate there is change in the usage of strategy - AUTO- @GeneratedValue(strategy = GenerationType.AUTO
Hibernate picks the TABLE generator instead of IDENTITY when the underlying database does not support sequences, please see - https://hibernate.atlassian.net/browse/HHH-11014

And we are getting below exception when we use the above
Schema-validation: missing table [hibernate_sequence]

Solution to this would be to use as below in class ApplicationPersistenceEntity.java and AdvancedRevisionEntity.java
@GeneratedValue(strategy = GenerationType.AUTO, generator = "native")
@GenericGenerator(name = "native", strategy = "native")
please see below link-
https://vladmihalcea.com/why-should-not-use-the-auto-jpa-generationtype-with-mysql-and-hibernate/

For Postgres,
Postgres works as it is but when the above solution is applied it gets exception below

Caused by: java.sql.SQLFeatureNotSupportedException: Method org.postgresql.jdbc.PgConnection.createClob() is not yet implemented.

To this we should add the following property in application.properties
spring.jpa.properties.hibernate.jdbc.lob.non_contextual_creation=true

please see the reference - spring-projects/spring-boot#12007 (comment)
already a issue added in hibernate for postgres
https://hibernate.atlassian.net/browse/HHH-12368

For oracle

getting below error when using oracle 11g xe

Flyway Enterprise or Oracle upgrade required: Oracle 11 is past regular support by Oracle and no longer supported by Flyway Open Source or Pro, but still supported by Flyway Enterprise.

As flyway community edition(open source) and Pro is not supported by oracle 11g xe

for oracle 12 C, the above error is resolved, It now works with the above said solution

Fixed with PR #679