oasp / oasp4j

The Open Application Standard Platform for Java
Apache License 2.0
60 stars 303 forks source link

Fixes for PR #665 #668

Closed hohwille closed 5 years ago

hohwille commented 5 years ago

After my review of #665 I hereby provide some improvement/fixes.

hohwille commented 5 years ago

FYI: Travis again is not usable due to technical issues. Local mvn clean install was successful.

hohwille commented 5 years ago

@vapadwal any review feedback?

vapadwal commented 5 years ago

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 - https://github.com/spring-projects/spring-boot/issues/12007#issuecomment-369388646 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

Will install oracle 12 c and see if it is working or not

vapadwal commented 5 years ago

After installing oracle 12 C, the above error is resolved, It now works with the above said solution.

hohwille commented 5 years ago

@vapadwal Thank you so much for your testing. This is extremely valuable feedback and information. Could you file a separate issue for that so we can start working on a fix. The problem you are describing is in no way related to the changes made in this PR. It is must probably related to PR #665 that has already been merged by me - so we can consider that as a mistake. However, this PR is only fixing things left out and therefore improves quality. Therefore I would love to see this approved and merged. If we have a separate bug issue that we can work on as another PR and hopefully fix and merge if possible for 3.0.0 all should be fine.

vapadwal commented 5 years ago

I have raised an issue https://github.com/oasp/oasp4j/issues/674 as the above issue has nothing to do with it.