[hibernate-issues] [Hibernate-JIRA] Resolved: (HHH-1092) Remove finalize() from the org.hibernate.jdbc.ConnectionManager class

Emmanuel Bernard (JIRA) noreply at atlassian.com
Thu Nov 2 23:38:05 EST 2006


     [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1092?page=all ]
     
Emmanuel Bernard resolved HHH-1092:
-----------------------------------

    Resolution: Fixed

Was fixed as part of HHH-1240

> Remove finalize() from the org.hibernate.jdbc.ConnectionManager class
> ---------------------------------------------------------------------
>
>          Key: HHH-1092
>          URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1092
>      Project: Hibernate3
>         Type: Improvement

>   Components: core
>     Versions: 3.1 rc2
>  Environment: HIbernate 3.0.5, Database is not related to problem, but Solid Embedded Database with a custom dialect.  (www.solidtech.com)
>     Reporter: John Adams

>
> Original Estimate: 1 day
>         Remaining: 1 day
>
> I just posted this to the user forums, and the immediate reply I got was to post this issue here.  I have cut and paste my original posting here to save myself a bit of work..  The estimate is a bit of a strange one for me .... removing the finalize is trivial.  Making sure hibernate is still safe and logs errors appropriately when connections don't get closed I imagine is not.  If it is trivial, it would be nice if this change could make it into Hibernate 3.1, it would really help real time performance issues.
> I marked it as major since this results in pausing of our JVM for periods of longer than 1 second, which means that we will have to address this issue.  (our server is time sensitive).     From our perspective this would be a major performance improvement, but I don't know exactly how to differentiate major & minor improvements in the program.
> /snippet of original issue.
> We have been using Hibernate successfully but with one problem, we have long gc pauses using the 1.5 concurrent collector. We previously had really long pauses with Hibernate 2.1.7, and had traced it down to the SessionImpl overriding finalize(). We looked at the 3.0.5 source and realized that SessionImpl had removed the finalize() modifier, which was great, so we upgraded. (I had read Gavin's blog on the topic)
> However, we had missed two important details ...
> 1) org.hibernate.jdbc.ConnectionManager also overrides finalize()
> 2) Our JDBC driver vendor overrides finalize() in their statements
> Now in our scenario, there is a 1:1 mapping between SessionImpl and ConnectionManager for various reasons, which kind of negates the advantage of taking finalize out of SessionImpl. We can help this situation out by using our Sessions for multiple database updates ... we're in the process of getting better about this. We also may be able to influence our database vendor to take the finalize() out of their driver, we need both to really fix our pausing with Sun's VM.
> However, it remains that the ConnectionManager overrides finalize(), even in 3.1 rc2. Is there any way that the override can be taken out ? Any other suggestions besides being more frugal with our SessionImpl's ?
> Regards,
> John.
> Hibernate version:3.05
> DatabaseVendor: Solid Embedded Database (http://www.solidtech.com/)
> Java Version: 1.5.0_04 (Sun)
> O/S: Linux Redhat 2.6.9
> ps. This shows up in the concurrent collector in long pauses as WeakReference processing if you want to see the effect. Finalizers create weak references, which is the bit the garbage collector complains about.

-- 
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