How to decide which persistence technology to use? JDBC / CMP Entity Beans / Hibernate / JDO ?

Almost every web application today talks to a database and so at the start of each project, one question is surely going to come up. Which persistence technology to use?

I tried to google my way to the answer however either my google skills
are limited or the answer / a fair  comparison of the available
technologies isn’t out there.

So I thought of making this blog
interactive. You post comments to this blog and state what you think is
for or against a particular technology. I will later compile all
suggestions into a tabular form. Keep your comments short so that they
can easily be placed in a tabular format.

Lets restrict the scope of the comparison to:

  1. JDBC
  2. Hibernate
  3. CMP Entity Beans
  4. JDO

Java persistence technologies. A comparison.between JDBC, Hibernate, CMP Beans and JDO


  JDBC Hibernate CMP Beans JDO
Plus
1 Everyone knows it Easy to learn Ease of use Vendor portable
2 Suited for small systems Good performance IDE support Many vendors
3 Performance JSR-220 (EJB3) persistence Resume booster Adopted by Apache
4 Stored procedure usage Middlegen code generation Middlegen code generation Geronimo Integration
5

Batch updates/inserts

    JDO vendors will support EJB 3 as well
6       Middlegen code generation
7       great help from vendors
Minus
1   Not backed by specification Heavy and complex Low acceptance
2   Have to learn on your own. Not enough help on forums Steep learning curve

Risky long term choice

3       Few credible vendors
4        
5        
Other comments and suggestions
1 Prevayler (not listed) – Best if you are making a very small system (in terms of data size) that WILL NOT grow significantly and you dont’ need a RDBMS. Very easy to learn. Pure OO. Fast development. Excellent performance.
2

What about IBatis?

3 Forget the specs go with the best tool for the job. And there are way more tools then just hibernate.
4 I can’t say use this or that. Each has it’s advantages. Choose one and stick with it.
5 In the Torpedo benchmark, the top 2 performers are JDO implementations, beating out TOPLink, Weblogic CMP, and Hibernate.
6 Torpedo is a very useless benchmark.
 

Content Team

The IndicThreads Content Team posts news about the latest and greatest in software development as well as content from IndicThreads' conferences and events. Track us social media @IndicThreads. Stay tuned!

39 thoughts on “How to decide which persistence technology to use? JDBC / CMP Entity Beans / Hibernate / JDO ?

  • February 19, 2007 at 12:07 am
    Permalink

    Hi there, Can anybody help me to deploy a CMP (EJB3) in JBoss 4.0.5 ? When I try with JDK1.5.0 and JDK1.6, I get the above error message in JBoss.

  • January 22, 2007 at 1:32 pm
    Permalink

    i will shamelessly advocate for hibernate any day of the week. there is plenty of help on the hibernate forums. the hibernate documentation is some of the best available for an open source project. if you can’t do 95% of what hibernate is designed to do within a week of downloading it, you need to castrate yourself…and be quick about it.

  • December 12, 2006 at 11:54 pm
    Permalink

    Can anyone suggest the technology which works well for two phase commit ? I am not worried about other features.

  • October 6, 2006 at 2:55 am
    Permalink

    Hi,

    Somebody please tell me, how I can use mssql stored procedures with hibernate.

    Thanks in advance,
    Peter

  • August 29, 2006 at 2:53 am
    Permalink

    how can i do code for batch processing using hibernate framework in java

  • October 29, 2005 at 10:08 am
    Permalink

    First of all, forget Hibernate for anything but a web-based servlet. It’s whole architecture is built around a web-based request/response cycle.

    Try posting a bug on Hibernate’s JIRA system. Even one that has a reproducible test case with a fix patch included. If Gavin likes it/is in a good mood, he’ll address it. If your use case is not interesting to him, then it will be rejected without comment.

    Try asking a question on the Hibernate user forum. If it’s an easy/newbie question, you’ll get lots of good help from the other users and a condescending RTFM from the development team. If it’s an intermediate question, you’ll get some wrong answers from other users, but you might get a good reply from the development team. If it’s a tough question or addresses an area that Hibernate is weak in, then it will either sit there unanswered, or you might get an answer from the development team like ‘don’t do it that way, you don’t know anything about databases.’

  • August 26, 2005 at 10:58 am
    Permalink

    I disagree that there isn’t enough help in the Hibernate forums. My experience has been the opposite. In fact, most of the responses that I’ve received were from the developers themselves.

  • March 20, 2005 at 8:44 am
    Permalink

    Iam a student of JAVA/J2EE and want to enter the java industry. By visiting some websites i read that .NET technology is coming up than java/j2EE and snatching away all the jobs.Also presently there are only maintainence jobs for java and no development .

    How far it’s true KINDLY CLARIFY

  • February 1, 2005 at 4:36 am
    Permalink

    The cost of not using standard tool usually is not felt until the project is done.
    I used DOA for two years, not because it was excellent — it has many bugs and error messages were misleading and not helpful at all — it was the only viable light-weight solution for Delphi then. Just imaginethose quirks the poor programmer had to learn after I left.

  • December 27, 2004 at 6:15 pm
    Permalink

    The freedom of speech and expression that Indians enjoy also has some drawbacks.
    The media has become too powerful and arrogant. Many news channels and newspapers now have started creating stories and do what they want with total disregard for law and conventions.

  • December 27, 2004 at 3:07 pm
    Permalink

    Updated the table. I have also added a new section where I have added snippets from the various comments that can help decide which persistence technology to use.

    To add comments using your name instead of the Guest id, all you need to do is register at IndicThreads.com. You can use this link http://indicthreads.com/user_extended/task,register/

  • December 24, 2004 at 6:05 am
    Permalink

    Back in the day when I was doing Delphi development I used a library DOA (Direct Oracle Access) http://www.allroundautomations.nl/doa.html which is an excellent tool ! It was not build to support any particular specs, but it was excellent all around… My point is: forget the specs go with the best tool for the job. And there are way more tools then just hibernate!

Leave a Reply