Lazy load EntityLoaders to improve memory usage

Description

We have a lot of LockMode s and we load an EntityLoader per LockMode which consumes quite a lot of memory.

We should lazy load them so that we don't create objects for all the LockMode s even if they are not used by the application.

Also adds the following setting to control whether these creations are delayed or done immediately:

This is a follow-up of this forum post: https://discourse.hibernate.org/t/batch-fetch-style-recommendations/631 and this discussion on the mailing list http://lists.jboss.org/pipermail/hibernate-dev/2018-May/017599.html and http://lists.jboss.org/pipermail/hibernate-dev/2018-May/017635.html.

Also

Environment

None

Status

Assignee

Guillaume Smet

Reporter

Guillaume Smet

Fix versions

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

backportDecision

None

Components

Priority

Major
Configure