The second candidate release for Hibernate ORM 5.0. CR2 was required because of a bug in how class-loading worked in certain managed JPA environments. The details can be found in HHH-9887. The main changes since CR1 include:

Corrected ClassLoader usage

This is the blocking issue mentioned above. The problem would occur in environments passing a "temp ClassLoader" into Hibernate via the JPA integration SPI (javax.persistence.spi.PersistenceUnitInfo#getNewTempClassLoader) and manifest itself as ClassCastExceptions.

Second-level caching SPI improvement

The second-level caching SPI was improved, allowing the caching providers to generate cache keys. This includes the addition of the following methods:

  • org.hibernate.cache.spi.access.EntityRegionAccessStrategy#generateCacheKey

  • org.hibernate.cache.spi.access.CollectionRegionAccessStrategy#generateCacheKey

  • org.hibernate.cache.spi.access.NaturalIdRegionAccessStrategy#generateCacheKey

Improved cache-by-reference support

For those making use of caching immutable entities by reference (rather than by "disassembled" state), an additional performance improvement is included in CR2.

Ability to disable auto-quoting of keyword-as-identifier

A new feature in 5.0 is the automatic quoting of identifiers that are believed to be keywords in the underlying database. As this support is new, often the Dialects are too aggressive in what they deem to be keywords. Thus we added a new setting to disable this behavior if it causes problems in your application. This can be controlled by specifying hibernate.auto_quote_keyword as false in configuration settings.

Significantly improved bytecode enhancement support

Including:

  • added ability for automatic management of bi-directional associations

  • self-contained dirty state tracking (more efficient flushing), including switchable algorithms for dirty determination

Odds-n-ends

Additionally many other improvements and bugfixes are included. See the changelogs for the complete list of changes.

The release tag is available on GitHub.

As always, see https://hibernate.org/orm/downloads/ for information on obtaining the releases.


Back to top