You asked for it, we deliver: Hibernate Search 5.7.0.Final, with support for Hibernate ORM 5.2.8, is out!
And of course, like previous versions, it features experimental support for Elasticsearch integration
(even with some improvements).
Stuck on an older ORM version? Don’t worry, we also released a bugfix version for 5.6, namely 5.6.1.Final.
Recently, the team has been discussing improvements around Hibernate (ORM) usage within cloud based apps and microservices.
In particular the fundamental assumption that things will break regularly on these platforms and that services should be resilient to failures.
Java 9 comes with a new feature very useful to library authors: multi-release JARs (JEP 238).
A multi-release JAR (MR JAR) may contain multiple variants of one and the same class, each targeting a specific Java version.
At runtime, the right variant of the class will be loaded automatically, depending on the Java version being used.
This allows library authors to take advantage of new Java versions early on, while keeping compatibility with older versions at the same time.
If for instance your library performs atomic compare-and-set operations on variables, you may currently be doing so using the sun.misc.Unsafe class.
As Unsafe has never been meant for usage outside the JDK itself,
Java 9 comes with a supported alternative for CAS logics in form of var handles.
By providing your library as an MR JAR, you can benefit from var handles when running on Java 9 while sticking to Unsafe when running on older platforms.
In the following we’ll discuss how to create an MR JAR using Apache Maven.