Should I upgrade / migrate Hibernate 2.5 to Hibernate 3.0 or directly to the latest stable version?

I have an application that uses Java SE 5 and Hibernate 2.5. I need to upgrade / migrate it to Java 6 and newer version of Hibernate. What is the best strategy?

Should I directly upgrade to the latest stable version (currently: 3.6), or does it make sense to just upgrade to 3.0?

Is there a lot of effort for such a migration?

I have no experience with Hibernate yet, but I have already used Toplink JPA 1.0 in projects. Can you give me some advice? Thanks...

Regards, Kai Wahner

+4
source share
3 answers

It depends. If you will be using Java EE, don't worry about Hibernate versions and focus on JPA 2.0. Hibernate will be just a JPA implementation. In case you really need a specific Hibernate function, check its version based on your AS implementation.

If you are not using Java EE, I would go with Hibernate 3.6 if I plan to deploy my application in a few months, or I would use 3.5 if I plan to deploy the application to production next week.

The main idea: to use the latest GA at a time when you put something in production. In this way, you guarantee that you will have a “supported” version for a long time.

It is also worth mentioning that community versions are not always supported by the provider. In this case, you will not receive a support contract from Red Hat for Hibernate 3.5 or 3.6. If you need support, you will have to choose any versions that they officially support.

+1
source

I am talking about the latest stable version, as it will contain additional improvements / fixes and will give you more benefits in general. Since then, there have been many changes, so the migration will not be trivial, but later, when you switch to future versions, the migration steps will be smaller and easier.

Check out the migration guides to help you.

0
source

What is the best strategy?

It depends if you need to support many projects. Only updates if you are working on a project. In other words, it is not broken, do not correct it. If you are still developing and running into library issues, check out more current versions that can be fixed.

0
source

Source: https://habr.com/ru/post/1333019/


All Articles