Exception and logging messages for collection multi-session access needs to be improved

Description

The following exceptions arise occasionally in scenarios where the exception text itself is insufficient to diagnose the underlying issue (e.g. there should have been only one session or the session should have been open).

  • org.hibernate.HibernateException: Illegal attempt to associate a collection with two open sessions

  • org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role:..., no session or session was closed

In some cases, the issue is not reproducible on-demand. The "first failure" capture needs to be improved to better point to the reason without the need to reproduce the failure.

Environment

None

Status

Assignee

Gail Badner

Reporter

Stephen Fikes

Fix versions

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Components

Priority

Major