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 |