Today, we published a new maintenance release of Hibernate ORM 6.1: 6.1.6.Final.

What’s new

This release introduces a few improvements, bug fixes, and a significant set of performance improvements.

Improvements

Second Level Cache

We have improved the initialization of an entity when a reference was found in the Second Level Cache avoiding the unnecessary call to the properties setter methods (see HHH-15666)

Query Results duplication checking

We have improved the method to check for duplicates of an HQL query result. This will reduce the amount of in-memory processing that the ORM needs to perform (see HHH-15479).

Mitigations for secondary super types cache

As explained in this blogpost, while investigating performance regressions we identified that some popular middleware libraries, including Hibernate ORM, are having performance being limited by an existing JDK issue JDK-8180450.

The OpenJDK team acknowledged its severity and is working on a fix scheduled for Java 21; we hope it will also be considered for backporting but in the meantime we’ve been patching our code so to limit the impact of it and not having to wait for it.

Examples of such patches are #5483, #5662, #5681, #5684, #5690, #5692, #5694, #5720.

These have been verified by the Red Hat Performance team; as we keep going, the highest priority issues have been solved, but we will still keep identifying some more. Hibernate ORM 6.2 is expected to have some more significant improvements as we have an additional batch of fixes which are not suitable for being backported to this maintenance branch.

Bugfixes

Polymorphic Queries

We have fixed a couple of issues related to Polymorphic queries:

  • a bug causing a PersistenceException for polymorphic queries having a where clause (see HHH-15718)

  • a bug causing a StackOverflow (see HHH-15744)

HQL queries and Converters

We have fixed a bug affecting queries involving attributes with a converter applied (see HHH-15742). Thanks to the new Hibernate ORM team member Marco Belladelli, who just joined our team last week and is already productive!

Embeddables

This release fixes also some bugs affecting Embeddables:

  • A @OneToOne(mappedBy = …​) within an embeddable was causing an IllegalArgumentException (see HHH-15606)

  • A ClassCastException was thrown when batch-fetching an association of an embeddable (see HHH-15644)

  • An ArrayIndexOutOfBoundsException was thrown when selecting an Entity having an Embeddable with more fields than the parent (see HHH-15658)

  • An UnknownTableReferenceException was thrown during the initialization of an ElementCollection of Embeddable containing a MayToOne association with an Entity containing a ManyToMany association (see HHH-15713)

  • When Batch Fetching was enabled, an Embeddable having a ot null association was considered null when all the other attributes were null (see HHH-15695)

  • A NullPointerException was thrown loading an Entity that contains a null Embedded property when dirty tracking was enabled (see HHH-15730)

You can find the full list of changes in this version here.

Conclusion

For additional details, see:

Feedback, issues, ideas?

To get in touch, use the usual channels:


Back to top