Hibernate or EclipseLink for JPA?

46,003

Solution 1

IMHO It is always better to use a standard api where possible. Your own example shows this perfectly. You were able to try your identical code on two providers when one failed to work as expected. Switching to any native API prevents you from doing this.

If using EclipseLink as your JPA 2.0 provider works well for you, then use it. If you do happen to run into an issue, file an EclipseLink bug, and get help on this forum, or the EclipseLink forums and Newsgroups.

Solution 2

EclipseLink is more standards compliant, since it is the reference implementation for JPA 2, Hibernate has some compliancy issues, but is more mature.

One of the main benefits of EclipseLink is that you can call native SQL functions directly in your JPQL queries. In Hibernate this is not directly possible.

But Hibernate has a bigger community, better documentation and also better error messages.

Solution 3

From my experience, with Java Perf Profiling. My apps built using Eclipselink seem to perform a lot better than with Hibernate both in Data insertion and retrieval. Hibernate however is more widely used and provides a bigger forum for support.

In production, I will simply take Hibernate for this reason.

Solution 4

Just pick and stick with one. Standards are just in the end guidelines and every implementer can implement or fail to implement the standards accordingly.

e.g.

  • EclipseLink has issues using something basic such as JPA @Converters though supposedly recently fixed through IBM http://www-01.ibm.com/support/docview.wss?uid=swg1PI73277

  • Hibernate's JPQL implementation does not understand boolean values that stand on their own more specifically I had to change my JPQL to say

    from Participant p where not p.cancelled

    to

    from Participant p where p.cancelled = false

The other thing is you're building things in Spring and you're likely going to do the improper but common approach of changing the class loader to PARENT_LAST order so your classes are used rather than the application servers.

If you plan to do the proper way and use the JPA that comes with the application server just be a bit wary in that your Application Server implementation may be buggy.

Transaction wise your application, specifically Spring must handle things for you.

Share:
46,003
Ta Sas
Author by

Ta Sas

Updated on May 10, 2020

Comments

  • Ta Sas
    Ta Sas almost 4 years

    I was wondering if anyone has experience with the JPA2.0 implementation of any of those frameworks? Especially together with Spring3.x which comes with EclipseLink support.

    Do you use any of those frameworks and JPA2.0 for production? Any severe issues?