[
http://opensource.atlassian.com/projects/hibernate/browse/HHH-2706?page=c...
]
Mike Quilleash commented on HHH-2706:
-------------------------------------
Instead of
'This will have performance implications because of the finalizer and the Exception
creation per Session'
I should have said
'This will have performance implications because of the finalizer and the Exception
creation per Session BUT will work and perform as usual when the option is disabled'
Add debugging option for detecting if a Session is unclosed
-----------------------------------------------------------
Key: HHH-2706
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HHH-2706
Project: Hibernate3
Issue Type: New Feature
Components: core
Affects Versions: 3.2.1
Environment: Any
Reporter: Mike Quilleash
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.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira