Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Pros and Cons of Hibernate vs JDO vs EJB3 based persistence new J2EE app to build

 
Prakas Subed
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Folks,

I need to collect some pros and cons of these; would you care to mention some please. And which would you chose... Thanks,
 
Dave Salter
Ranch Hand
Posts: 293
Java Mac OS X Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've never used JDO so I can't really comment on that.

Hibernate is available now, in a stable release format. It will work on any application server, or on any J2SE app, so you probably won't get any major issues with Hibernate.

EJB3 Persistance is still not finalized (AFAIK), however I don't think there will be any major changes (if any) before the spec is finalized. According to this post, EJB is expecting to be finalized towards the end of this year and there may therefore be changes to any EJB3 implementation before then.
 
James Jordan II
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This link should give you a lot of what you're looking for:

http://www.codefutures.com/weblog/corporate/archives/2005/02/data_persistenc.html
 
Mike Keith
author
Ranch Hand
Posts: 304
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Huh? How could the blog entry help if it didn't even mention EJB3? Not much of a comparison.
 
Mike Keith
author
Ranch Hand
Posts: 304
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Prakas,

It really depends upon your need. Ask yourself a few questions before you go in any particular direction.

How big is your app going to be, and how big will it ever possibly be?
If it is small and guaranteed to stay small (be careful about answering yes to that, though!) then any proprietary persistence framework, like Hibernate, could serve your need. If you ever need to change for politiacl reasons then it won't be too big a deal.

Are standards important to your company? If so, then you will obviously want to make a descision that won't gt you in trouble.

When is your app slated for completion? JDO 2 could be final by the end of the year and EJB 3 will be final in first quarter of next year, so if you will be complete sometime in the next year then you should be safe either way.

How much risk are you willing to take? JDO does not have any support for any of the major vendors, but the spec seems to be headed in the direction of open source, so if you are comfortable with it there then it could work for you.

EJB 3 is the endorsed spec for the new Java EE platform, and has the support of all of the vendors, but only Oracle and JBoss of the major Java EE container vendors have preview implementations to date. If you are looking to use WebSphere, for example, you might want a release from IBM, and it could be a risk if it is not ready when you need it.

Hope this helps,
-Mike
 
James Jordan II
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Mike Keith:
Huh? How could the blog entry help if it didn't even mention EJB3? QB]


Yes it does. Look again. In the section on EJB CMP.



Originally posted by Mike Keith:
[QB] Not much of a comparison.


It's the best I've found. Have you got a better link to provide?
 
Eric Samson
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello

JDO 1 is official since 2002 and already supported by more than 30 products, many of them being open source. Most known commercial products like Kodo and LiDO (now Xcalia Intermediation Core = XIC) are very stable and support a lot of flexible options for O/R mapping. They are coming with visual tools for assisted mapping.
These vendors are not big players like IBM but they are focused on persistence and they deliver top quality products and services.
Being independent from big database and app servers vendors they guarantee portability.
JDO is also supported by large vendors like Sun and SAP.

JDO 2 now supports a better query language and fully specifies the O/R mapping. Preview versions are available from most known products.

The great difference between JDO and EJB3 is that JDO is not limited to persistence into relational databases. That could be important in enterprise applications when you need to access RDBMS, XML files, mainframes transactions and Web Services.

Now, if you are only interested in ORM then EJB3, JDO 2 are quite similar standard. Most vendors will support both APIs, and will provide portability (migration)options. This is not a big deal. We also hope that one day a kind of convergence will be defined into a common ORM standard (javax.persistence or something like that).

That said, as a developer you use a product, not a standard.
So, you must compare products, based on their stability, performance, features, flexibility options, visual tools, integration in your environment, reactivity of vendor and ROI.

On a simple prototype most products will look quite similar. But it is more interesting to see how they will react in much more constrained environments (huge database, complex object models, high transaction...).

Best Regards, Eric.
 
Pj Murray
Ranch Hand
Posts: 194
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks James for pointing out my blog entry.

Apologies Mike if you didn't find the commentary on EJB 3.0 detailed enough. Since it's a new draft spefication, it was not a priority.

The Java persistence parts of EJB 3.0 will have some strengths and weaknesses, like just about every other Java persistence technology.

It's not going to be the one-size-fits-all universal solution. And it would be truely remarkable if the new specification was 100% correct in its first implementation. Just like JDO, I expect there will be revisions that fill in any gaps that are identified by the early adaptors.

Before you focus on your choice of Java peristence technology, you might find some background reading useful:


Java Persistence Architecture: A Project Manager´┐Żs Guide

http://www.codefutures.com/weblog/andygrove/archives/2005/05/java_persistenc.html



Data Access Object (DAO) versus Object Relational Mapping (ORM)

http://www.codefutures.com/weblog/andygrove/archives/2005/02/data_access_obj.html



Choosing a Java Persistence Strategy

http://www.codefutures.com/weblog/andygrove/archives/2005/01/choosing_a_java.html
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic