LazyInitializationException in ToOneIdMapper when attempting to initialize Hibernate proxy.

Description

In ToOneIdMapper.mapToMapFromEntity() Hibernate proxy initialization is attempted using session which was originally used for loading that entity. However, by that time, that session could be closed (and reference to it could be removed from lazy initializer instance). Attached test case demonstrates such a scenario.

Environment

JDK 8

Assignee

Chris Cranford

Reporter

Janko Petrovic

Fix versions

None

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Worked in

5.4.10

Components

Affects versions

Priority

Major
Configure