File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Object Relational Mapping and the fly likes Hibernate or EJB Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Object Relational Mapping
Reply Bookmark "Hibernate or EJB" Watch "Hibernate or EJB" New topic
Author

Hibernate or EJB

Bunty Paul
Greenhorn

Joined: Jun 26, 2006
Posts: 28
We are developing an application and are planning to use Hibernate. But few are suggesting to go for EJB. The application basically contains adding new records, editing, removing, searching etc. So which one should i go for and can you also tell me about the performance of each. Application will be deployed using JBoss 4.5.

Thanks
Bunty Paul.
Pj Murray
Ranch Hand

Joined: Sep 24, 2004
Posts: 194
By EJB, I presume you mean EJB 3.0 - JPA?

In which case, it's not really going to make much difference as you're using the JBoss technology stack either way.

Unless there's some good reason to use Hibernate, you may as well just use EJB 3.0 in the app server (which is based on Hibernate anyway). That will at least reduce your maintenance because you'll have one less thing to manage.


PJ Murray - Sites developed using CodeFutures technology:
Workplace Drug Testing and Injury Compensation
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 16622

Hibernate is an implementation of EJB 3.0 JPA. So it isn't an either or question. You can choose to make sure you only use the API classes of JPA, and not Hibernate specific add-ons to JPA.

Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
Yuval Goldstein
Greenhorn

Joined: Dec 27, 2006
Posts: 18
Personally, I think we should still have some patience with EJB 3 implementations. Most major vendor offer them, but it is still a rather new technology. I think that once we see one or two service packs for tje first GA EJB3 version we can start take this option seriously.

Im not always in favor of taking the cautious path but in this case I think you can enjoy most EJB3 features with plain old Hibernate (and Spring).

If you do take the EJB3 path, make sure you have a strong commitment and support from your application-server vendor representatives. You will need it.


Cheers.
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 16622

Originally posted by Yuval Goldstein:
Personally, I think we should still have some patience with EJB 3 implementations. Most major vendor offer them, but it is still a rather new technology. I think that once we see one or two service packs for tje first GA EJB3 version we can start take this option seriously.

Im not always in favor of taking the cautious path but in this case I think you can enjoy most EJB3 features with plain old Hibernate (and Spring).

If you do take the EJB3 path, make sure you have a strong commitment and support from your application-server vendor representatives. You will need it.


Cheers.


You do make is it sound like it is very new. But I will say that the Hibernate implementation of JPA is already about 2 years old. It is very mature and very stable. You do not need to be any more patient.

Mark
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 16622

Originally posted by Mark Spritzler:


You do make is it sound like it is very new. But I will say that the Hibernate implementation of JPA is already about 2 years old. It is very mature and very stable. You do not need to be any more patient.

Mark


Actually I think it is more than 2 years old. Because I have been using EJB3 in production for almost 2 years myself (Have found no issues at all to JBoss's implementation), and I know that Hibernate had some implementations of JPA well before that.

Mark
Yuval Goldstein
Greenhorn

Joined: Dec 27, 2006
Posts: 18
BEA only released EJB 3 Support about a month ago.
JBoss did it a while ago but their EJB GA version is no more than 3 monnths old i think (the version that they say the recommend for production use).
IBM Websphere 6.1 with EJB? Only several months old.

If youre starting a 2 year (calendar time) project, go ahead, the technolcogy will be ok when the time for production comes but if your starting a tight 6 month project today, I recommend doing it the hibernate way,

I had (and still having) my own share of scary bleeding edge near-GA java products and i prefer to take it more slowly this time,
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 16622

Originally posted by Yuval Goldstein:
BEA only released EJB 3 Support about a month ago.
JBoss did it a while ago but their EJB GA version is no more than 3 monnths old i think (the version that they say the recommend for production use).
IBM Websphere 6.1 with EJB? Only several months old.

If youre starting a 2 year (calendar time) project, go ahead, the technolcogy will be ok when the time for production comes but if your starting a tight 6 month project today, I recommend doing it the hibernate way,

I had (and still having) my own share of scary bleeding edge near-GA java products and i prefer to take it more slowly this time,



there is a slight difference between fully passing Sun's tests to be "certified" but I promise you that the implementation by JBoss has been compliant for even longer than that. And it works very well in production. As I have experience using it in production for about 2 years now.

Not really bleeding edge in my experience. But that is fine, we can all have our own opinions.

Mark
 
 
subject: Hibernate or EJB
 
Threads others viewed
Can Hibernate 3.0 support MQ WAS
EJB 2.0 EJB 3.0 Hibernate Architectural Desicion
Hibernate vs EJB 3.0
new to hibernate
differences between EJB 3.0 & Hibernate?
developer file tools