[hibernate-issues] [Hibernate-JIRA] Created: (HHH-2538) HibernateSessionFactoryImpl should have a finalizer method releasing resources and logging a warning if the object was not closed

Rene Grob (JIRA) noreply at atlassian.com
Sun Apr 1 13:44:04 EDT 2007


HibernateSessionFactoryImpl should have a finalizer method releasing resources and logging a warning if the object was not closed
---------------------------------------------------------------------------------------------------------------------------------

                 Key: HHH-2538
                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2538
             Project: Hibernate3
          Issue Type: Improvement
          Components: core
    Affects Versions: 3.2.0.ga
            Reporter: Rene Grob
            Priority: Minor


If due a programming failure the HibernateSessionFactory is not closed, the resources are not released when the HibernateSessionFactory object gets garbage collected. In complex frameworks it can be very hard to track down memory leaks like this. A finalizer method could make it much easier to find unclosed HibernateSessionFactory objects. It should check if the object is closed and if not, release the resources by closing the object and log a warning or even an error. There might be more objects which would profit of a finalizer method and help hibernate to get more stable. I'm aware that a finalizer adds a minor  overhead but for heavy weight objects like HibernateSessionFactory the difference is probably not mesurable.

-- 
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.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the hibernate-issues mailing list