RE: finalize in LargeObject - Mailing list pgsql-jdbc

From Dickson, John
Subject RE: finalize in LargeObject
Date
Msg-id A72970A71811D111960000A0C96ECB2AD6F0D3@aquarius.powerplus.com.au
Whole thread Raw
In response to finalize in LargeObject  (Philip Crotwell <crotwell@seis.sc.edu>)
Responses RE: finalize in LargeObject  (Philip Crotwell <crotwell@seis.sc.edu>)
List pgsql-jdbc

> From: Bruce Momjian [mailto:pgman@candle.pha.pa.us]
> > Shouldn't there be a
> >
> > protected void finalize() {
> >     close();
> > }
> >
> > in LargeObject.java so that the db resources are released when it is
> > garbage collected or am I missing something?

Without knowing the implementation details, I'd at least say that you should never rely on finalizers being run to release resources - they're not event guaranteed to run at all, let alone within a reasonable time.

Cheers ...................... JohnD

------------------------------------------------------------------------
        John Dickson - Java developer - PowerPlus Australia
        johnd@pplus.com.au                  Ph 07-3367 0533
------------------------------------------------------------------------

NOTICE - The information in this e-mail and any attachments is confidential and is intended for the addressee only. Reading, copying, disclosure or use by anybody else is not authorised. The contents do not represent the opinion of PowerPlus or any of its affiliates except to the extent that it relates to their official business. If you are not the intended recipient, please delete this message and any attachments and advise the sender by return e-mail.

Virus protection is in place at PowerPlus, however virus protection remains the responsibility of the recipient.

pgsql-jdbc by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: finalize in LargeObject
Next
From: Joe Shevland
Date:
Subject: RE: finalize in LargeObject