EJB against sleep mode

When is it better to use Hibernate and when is EJB 3? Are there any obstacles in either Hibernate or EJB 3?

+4
java hibernate
source share
2 answers

I'm here in a direct sleeping camp.

Think about how likely it is that your intention is to change your database from, say, DB2 to oracle, and it's about the same as switching from Hibernate to Toplink or eclipse, it just doesn't happen that often. This is the oldest thing that programmers just love to do, and this is an abstraction of any material so that at some unforeseen moment in 10 years they can choose to use a different set of tools for logging, and what not.

I'm sure people who really want the independence of a JPA provider, but I'm not one of them. This does not mean that Toplink or eclipse are not good, I just do not think that you can use a product that is complex and not connected (even inadvertently) with it in any way.

Having said that I still adhere to the documentation recommendations in sleep mode and use JPA annotations and resort to using sleep mode only when I need it, I'm not quite sure if there is a technical reason for this, but it won’t hurt.

+8
source share

Since Hibernate can be used as an implementation for JPA, you can use it and still use EJB3. So I agree with gid and suggest you use JPA stuff in Hibernate until you can, and only then go to Hibernate specific bits.

+2
source share

All Articles