Skip to content

Upgrade to spring-boot 2.1.x with hibernate 5.3 and JPA 2.2 #12

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
hohwille opened this issue Sep 24, 2018 · 13 comments
Closed

Upgrade to spring-boot 2.1.x with hibernate 5.3 and JPA 2.2 #12

hohwille opened this issue Sep 24, 2018 · 13 comments
Assignees
Labels
enhancement New feature or request spring springframework and spring-boot
Milestone

Comments

@hohwille
Copy link
Member

Hibernate 5.3 is already out since a while and fully supports JPA 2.2:
https://www.thoughts-on-java.org/hibernate-5-3/
We should therefore use the official JPA 2.2 by replacing

      <dependency>
        <groupId>org.hibernate.javax.persistence</groupId>
        <artifactId>hibernate-jpa-2.1-api</artifactId>
        <version>1.0.0.Final</version>
      </dependency>

with

      <dependency>
        <groupId>javax.persistence</groupId>
        <artifactId>javax.persistence-api</artifactId>
        <version>2.2</version>
      </dependency>

To do so we also need to upgrade to hibernate 5.3 what will come with spring-boot 2.1.0:
spring-projects/spring-boot#11725
But currently not even the milestone 2.1.0.M1 is in maven central.

@hohwille hohwille added enhancement New feature or request spring springframework and spring-boot labels Sep 24, 2018
@hohwille hohwille added this to the release:3.1.0 milestone Sep 24, 2018
@AbhayChandel AbhayChandel self-assigned this Jan 17, 2019
@maybeec
Copy link
Member

maybeec commented Feb 19, 2019

SpringBoot 2.1 is release since a while and it comes with Java 11 support.
Currently, Java 11 support is most valuable for projects as Java 8 is at EOL and Java 11 will be the next LTS to go for. Therefore, I think we should definitively do the migration soon.

@anmaso
Copy link

anmaso commented Feb 19, 2019

I also think we should go evergreen JVM and give support to older JVMs as exceptional cases.

@maybeec
Copy link
Member

maybeec commented Feb 19, 2019

Nicely, SpringBoot 2.1 did not remove support for Java8, so we finally could and should have support for Java LTS versions.

@maybeec
Copy link
Member

maybeec commented Feb 19, 2019

I just did it for my project, which seems to work smoothlessly.
Anyhow, we are in a early phase, so maybe some more bigger applications might face some issues. For my project I could not find any reason, why it should not work from the upgrade documentation.

https://github.com/spring-projects/spring-booT/wiki/Spring-Boot-2.1-Release-Notes#upgrading-from-spring-boot-20

So possibly low effort for devonfw.

@hohwille
Copy link
Member Author

It would be lovely if we also add a migration step for devcon. Ideally from devon4j:3.0.0 to 3.0.1 (with only the version update) and from there to 3.1.0 containing all required changes we might see for this upgrade here.

hohwille pushed a commit that referenced this issue Mar 5, 2019
* Removed javax.persistence:javax.persistence-api dependency from devon4j-bom
@hohwille
Copy link
Member Author

Done.

@hohwille
Copy link
Member Author

I just tested these changes and found a severe issue:

Caused by: org.flywaydb.core.internal.license.FlywayEnterpriseUpgradeRequiredException: Flyway Enterprise Edition or Oracle upgrade required: Oracle 11.2 is past regular support by Oracle and no longer supported by Flyway Community Edition, but still supported by Flyway Enterprise Edition.
	at org.flywaydb.core.internal.database.base.Database.ensureDatabaseIsCompatibleWithFlywayEdition(Database.java:162)

This really sucks and feels like piracy. We need to consider how we want to proceed.

@hohwille hohwille reopened this Apr 29, 2019
@maybeec
Copy link
Member

maybeec commented Apr 30, 2019

I recognized this as well, anyhow for my project it was not an issue as we are running oracle 12.
Anyhow, flyway comes with a very small maintenance window for free. Everything else is paid.
I would suggest to not stop our migration plans as of that and better test compatibility the new spring boot and hibernate version, while downgrading flyway.
For the official release I would keep the spring boot managed version of flyway, but in the wiki, you can easily describe how to downgrade flyway to work with oracle 11 and what pitfalls may come with it.

@hohwille
Copy link
Member Author

hohwille commented May 9, 2019

However, we might consider releasing a devon4j 3.0.1 release as well with the latest spring-boot 2.0.x as they have fixed many CVEs by updating libs but not forcing to go to flyway.
Further we should maintain release-notes properly stating such facts as this is important to the projects.

@hohwille
Copy link
Member Author

hohwille commented May 9, 2019

BTW: we have inconsistent statements regarding flyway 5.x.
In Yammer was stated that is neither works with Oracle 12.
Malte is however saying that it does work with Oracle 12, what would be much more relaxing as most projects are already on Oracle 12.

@hohwille
Copy link
Member Author

We are talking about the latest flyway version 5.4.2 that comes with the new spring boot:
view-source:https://repo1.maven.org/maven2/org/springframework/boot/spring-boot-dependencies/2.1.4.RELEASE/spring-boot-dependencies-2.1.4.RELEASE.pom

For such flyway version the OSS edition has dropped support for Oracle 11 and 12.1.
However 12.2+ is still supported:
https://flywaydb.org/documentation/database/oracle

@hohwille
Copy link
Member Author

hohwille commented Jul 1, 2019

spring-boot needs to be updated to 2.1.6.RELEASE which is meanwhile the latest version available:
https://repo1.maven.org/maven2/org/springframework/boot/spring-boot-dependencies/2.1.6.RELEASE/

Please create PR, then we merge and close this issue. Thanks.

@hohwille
Copy link
Member Author

hohwille commented Jul 4, 2019

Finally at latest version with PR #111 threfore done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request spring springframework and spring-boot
Projects
None yet
Development

No branches or pull requests

5 participants