Avoid annotation readings in or lazy initialization of AbstractServiceRegistryImpl

Description

We checked that it is possible that some annotations are read after that the SessionFactory instance has been created.
See this pull request.

Here is an instance of stack frames:

For a classic Java stateful application that is fine, but it would be an issue if we executed the same code with GraalVM, using for instance the Quarkus native generation.

For the new cloud native paradigm, code is supposed to be run in an immutable PAAS. It imposes a stateless approach: all the choices and initialization must me done before a pod/container runs.

Environment

None

Status

Assignee

Unassigned

Reporter

Fabio Massimo Ercoli

Fix versions

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Components

Affects versions

Priority

Major
Configure