Rejected
Details
Assignee
UnassignedUnassignedReporter
MikeMMikeMComponents
Priority
Major
Details
Details
Assignee
Unassigned
UnassignedReporter
MikeM
MikeMComponents
Priority
Created July 3, 2007 at 6:28 PM
Updated April 4, 2024 at 1:00 PM
Resolved April 4, 2024 at 1:00 PM
In H2 the Session would log a warning if close was not called. This was removed in H3 due to performance issues of using a finalizer.
It can often be very difficult to track down unclosed Sessions so I would like to propose an option be added for restoring this functionality with an enhancement.
Add a Session implementation that wraps another Session which will
Pass through all methods.
Create but not throw an Exception on creation
Watch for "closure" methods and record as appropriate.
Have a finalizer that checks for the Session not being closed and logs a warning and the exception created with the Session's stacktrace.
Then on any Session creation by SessionFactory, if the option is enabled, wrap the Session with the wrapper above.
This will have performance implications because of the finalizer and the Exception creation per Session. But as a debugging tool it could be very useful.
I am open to creating a patch if there is interest.