Today, we published a new maintenance release of Hibernate ORM 6.1: 6.1.6.Final.
This release introduces a few improvements, bug fixes, and a significant set of performance improvements.
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)
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).
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.
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.
We have fixed a couple of issues related to Polymorphic queries:
This release fixes also some bugs affecting Embeddables:
@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.