Temporary session not being closed

Description

In some cases, for example when AssertionFailure "bug adding collection twice" is thrown, temporary session is not being closed.
In our case this caused connection pool starvation and application death.
I presume, method addUninitializedDetachedCollection, potentially capable of throwing Exception should be within try/finally block

Environment

None

Assignee

Unassigned

Reporter

Dmitriiy Churilov

Fix versions

None

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

backportDecision

None

Components

Priority

Critical
Configure