wood burning stoves 2.0*
The moose likes EJB and other Java EE Technologies and the fly likes EJB 3.0 and Hibernate Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "EJB 3.0 and Hibernate" Watch "EJB 3.0 and Hibernate" New topic
Author

EJB 3.0 and Hibernate

Bruce Jin
Ranch Hand

Joined: Sep 20, 2001
Posts: 666
I heard that EJB 3.0 was inspired by Hibernate. Is this true?


BJ - SCJP and SCWCD
We love Java programming. It is contagious, very cool, and lot of fun. - Peter Coad, Java Design

Crazy Bikes created by m-Power
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17249
    
    6

Wow, that would be amazing that an ORM tool can inspire Session Beans and Message Driven Beans.

Hibernate 3.0 is an implementation of JPA, which is what EJB 3 Entity Beans implement.

Gavin King was a part of the EJB 3.0 Spec team, and I am sure had some help in creating the JPA spec, but to say Hibernate inspired EJB 3.0 would be wrong, and unfair to everyone on that team. All Persistent technologies inspired EJB 3 Entity Beans, why not take the best from all of them and combine them into the super incredible spec that JPA is.

Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
Rajeev Ravindran
Ranch Hand

Joined: Aug 27, 2002
Posts: 455
I dont want to create a new thread for the same topic since my question is related to Hiberate and EJB 3

I never got a chance to work in EJB though I hold SCBCD. I HAD good theoretical knowledge about EJB's but i never had seen it used anywhere in the projects i have involved , not even in other projects in the companies i worked. Why do we need a heavy component like EJB's when we can acheive the same persistance using Hibernate ? How are EJB3.0 and Hiberate related and what are the advantages of EJB3.0 over Hibernate ? yup, i didnt google it, i thought to hear it from the authors

Thanks,
Rajeev


SCJP, SCWCD, SCBCD, Oracle Certified Professional (SQL n PL/SQL)
Bruce Jin
Ranch Hand

Joined: Sep 20, 2001
Posts: 666
Good question.

What EJB can achieve that other technologies (Spring + Hibernate + POJO etc) cannot?

How to justify the use of EJB?

Thanks.
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17249
    
    6

First what would be pointed out in other places, a question like

"what are the advantages of EJB3.0 over Hibernate"

Would like what are the advantages of Apples over Green Apples?

Hibernate 3.x is an implementation of EJB3.0 or better an implementation of JPA, so it really isn't an either or, it is a question of which implementation of EJB3.0/JPA that you want to use. Use Hibernate is a superset of JPA, meaning that there are some add-ons to Hibernate that has some more features than what is in the spec, but if you program to the JPA spec with Hibernate you have JPA.

Mark
Sudd Ghosh
Ranch Hand

Joined: Oct 23, 2002
Posts: 187
Looking forward to a good answer to Bruce and Rajeev's questions.

With all the past EJB failures, it becomes difficult to convince the management that EJB3.0 is really great. Moreover, with Struts-2/Spring, POJO, hibernate combination, many companies are already feeling satisfied. I know of many commercial app running very successfully with this architecture. Moreover, this existing arcitecture DOES have the neat stuffs like, container injection, interceptors, etc - may be not annotations/generics if prior to Java1.5.

Hence, I think there should be a solid reason for why one should think of EJB3.0 and not go with the proven model.


SCJP 1.4, SCWCD, SCBCD 1.3
Bruce Jin
Ranch Hand

Joined: Sep 20, 2001
Posts: 666
Can we say EJB is a standard (part of J2EE) and Hibernate is not?

Is this a reason to use EJB even it is not really superior to Hibernate?
Jon Wetherbee
author
Ranch Hand

Joined: Oct 05, 2006
Posts: 33
Hi All-

(from the related EJB3 versus Spring thread

I posted my general thoughts on this in this thread. As a further comment, I'll say that it is to the JSR-220 expert group's credit that it is incorporating technologies such as Spring/TopLink/Hibernate into the EJB 3 spec and turning them into standards. I would expect further advances in these areas, and in the "next" hot areas, to be incorporated into the spec in the future.

Regards,
Jon
Ko Ko Naing
Ranch Hand

Joined: Jun 08, 2002
Posts: 3178
Becoming a new standard like EJB 3 is always better than several scattered technologies. That's one of the purposes of JCP group: "Making standards".


Co-author of SCMAD Exam Guide, Author of JMADPlus
SCJP1.2, CCNA, SCWCD1.4, SCBCD1.3, SCMAD1.0, SCJA1.0, SCJP6.0
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17249
    
    6

Originally posted by Bruce Jin:
Can we say EJB is a standard (part of J2EE) and Hibernate is not?

Is this a reason to use EJB even it is not really superior to Hibernate?



Yes and No. EJB is the standard and Hibernate is an implementation of that standard, plus more, which means the more stuff isn't a standard.

Mark
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: EJB 3.0 and Hibernate
 
Similar Threads
differences between EJB 3.0 & Hibernate?
Will Ejb3 make other technologies not used
Hibernate vs EJB 3.0
ExceptionInInitializerError NoClassDefFoundError
EJB 2.0 EJB 3.0 Hibernate Architectural Desicion