Technology » JPA, Hibernate, and Co. » JPA Provider Bug Parade

JPA Provider Bug Parade

Hibernate and EclipseLink are the only JP providers that I have tried, but they still contain numerous, sometimes incomprehensible bugs. Below you can find a list of bugs that I have coped with, sorted by JPA provider and status.

Hibernate Bugs

Potential

  • [MAPPING]: "JOKE" bug JPA 2.0 @IdClass mapping with Hibernate throwing the same exception as AssertionFailure: ... below (reported).

    Note: I suspect the Hibernate people haven't yet realized that JPA 2.0 allows nesting of ID classes, so I saved myself the energy of reporting a bug that will likely vanish as soon as the "AssertionFailure" bug below is fixed.

Reported

Fixed

None

EclipseLink Bugs

Potential

Reported

Fixed

EclipseLink Enhancements

Reported

Personal Rant

I have a lot of respect for Hibernate, but the number of JPA mapping bugs I alone have reported shows how inferior this software is often is toward JPA compatibility, especially when composite keys are involved. One prime example is an absolutely ridiculous bug that has recently occurred in Hibernate (given that the bug occurrs even with the latest versions of Hibernate, that is 3.5+ and 4).

The main problem with Hibernate is that it generally takes its maintainers months to look at bugs and even if it's somwhat obvious to fix they don't if the JPA spec isn't absolutely clear. Furthermore, getting any help from the Hibernate forums is virtually impossible as the activity there is almost zero. Determining whether an issue is just a misunderstanding of JPA or a bug regularly becomes an adventure (stackoverflow.com to the rescue!).

EclipseLink isn't perfect, but in contrast to Hibernate it only has a few issues and it usually takes its maintainers just a few weeks to fix bugs. Furthermore, the EclipseLink forums are a lot more active and their maintainers also seem to be around, so determining whether an issue is really a bug is a lot easier than with Hibernate.

Overall Hibernate has a lot more JPA mapping issues than you would think. In my opinion the Hibernate bugs HHH-5695, HHH-5764, and HHH-6221 can be real "show stoppers". Especially the latter one can't be worked around. It somehow makes Hibernate less tolerant and that can sometimes be a pain in the rear, especially when considering that Hibernate is an open-source project.

However, Hibernate does a slightly better job concerning non-JPA mappings, e.g. relationships to non-primary key columns. It might be Hibernate's history why this is working better than with EclipseLink.

JPA ORM softwares can be very frustrating to newcomers. I will continue my mission to track down and report mapping bugs - even if it means to flood the Hibernate JIRA.