开发者

Should I upgrade / migrate Hibernate 2.5 to Hibernate 3.0 or directly to the newest stable release?

开发者 https://www.devze.com 2023-01-31 14:31 出处:网络
I have got an application which uses Java SE 5 and Hibernate 2.5. I have to upgrade / migrate it to Java 6 and a newer version of Hibern开发者_运维知识库ate. What is the best strategy?

I have got an application which uses Java SE 5 and Hibernate 2.5. I have to upgrade / migrate it to Java 6 and a newer version of Hibern开发者_运维知识库ate. What is the best strategy?

Should I directly upgrade to the newest stable release (at the moment: 3.6), or does it make more sense to just upgrade to 3.0?

Is it a lot of effort to do such a migration?

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

Best regards, Kai Wähner


Depends. If you'll use Java EE, then don't bother with Hibernate versions and focus on JPA 2.0. Hibernate will be just the implementation for the JPA. In case you really need some Hibernate specific feature, then check what's its version based on your AS implementation.

If you are not using Java EE, then I would go with Hibernate 3.6 if I'm planning to deploy my app in some months, or I would use 3.5 if I plan to deploy the app to production sometime next week.

The basic idea is: use the latest GA at the time you put something in production. This way, you ensure that you'll have a "supportable" version for a long time.

It's also worth mentioning that the Community versions are not always supported by the vendor. In this case, you won't get a support contract from Red Hat for Hibernate 3.5 or 3.6. If you need support, then you'll have to chose whatever versions they officially support.


I say go for the latest stable release as it will contain further improvements/bugfixes and give you more benefit overall. There have many changes since 2.5 so the migration will not be trivial, but later on, when you upgrade to subsequent versions, the migration steps will be smaller and easier.

Take a look at the migration guides to help you.


What is the best strategy?

It depends, if you have to maintain a lot of projects. Only do updates if you're working on a project. In other words it it isn't broken don't fix it. If you are still developing and you face problems in libraries then check more current versions which could have the bug already fixed.

0

精彩评论

暂无评论...
验证码 换一张
取 消