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

Assignee

Unassigned

Reporter

Fabio Massimo Ercoli

Fix versions