Explicitly validate the version of Hibernate ORM

Description

It's apparently a frequent problem for users to have the wrong expectation on compatibility across Hibernate projects - in particular Hibernate Search vs Hibernate ORM.

Let's explore the possibility to fail fast when we detect a version of Hibernate ORM which is not the one we expect to be compatible with, and throw a pretty clear error message.

I realize such a system can't be 100% foolproof nor take into account all of future versions, but being able to detect some versions which are definitely not compatible would be better than nothing.

Activity

Show:

Sanne GrinoveroJune 14, 2016 at 4:58 PM
Edited

A problem with throwing a "fail fast" exception, is that we might end up failing a boot with a newer version of Hibernate ORM which could actually have worked "just fine".

For example: Hibernate Search 5.5x was meant to work with Hibernate ORM 5.0.x but when ORM 5.1 came out, it was totally fine too. Hibernate ORM 5.2 however was totally incompatible.

We probably want to log a warning only for "ahead" versions, and a fail-fast exception for older versions which are known to not be compatible.

Sanne GrinoveroMarch 2, 2015 at 1:21 PM

See also this Stack Overflow question

Details

Assignee

Reporter

Components

Priority

Created March 2, 2015 at 1:20 PM
Updated September 25, 2023 at 2:48 PM