Re: Calling Connection.close() in Connection.finalize() - Mailing list pgsql-jdbc

From Matthias Brunner
Subject Re: Calling Connection.close() in Connection.finalize()
Date
Msg-id 200208151956.55907.mb@blumenstrasse.vol.at
Whole thread Raw
In response to Re: Calling Connection.close() in Connection.finalize()  (Barry Lind <barry@xythos.com>)
List pgsql-jdbc
On Thursday 15 August 2002 19:43, Barry Lind wrote:
> Matthias,
>
> That is the behavior I would expect.  If you don't close the connection
> you will see this.  The reason here is the JVM doesn't run finalization
> when it is exiting.  So you didn't close the connection and the finalize
> method is never called because you are just exiting before garbage
> collection runs.
>

Thanks, you're right.
After executing "con=null;System.gc();" the database connection is closed
properly.
Dumb I was thinking of the finalize method as a C++-like destructor which must
always be called.
Again, thanks for your efforts.

Cheers!
--
Matthias Brunner <mb@blumenstrasse.vol.at>
PGP FP 7862 32B3 3B75 292A F76F  5042 8587 21AB 5B89 D501
Check out http://blumenstrasse.vol.at/~mb/gpgkey.asc


pgsql-jdbc by date:

Previous
From: Felipe Schnack
Date:
Subject: datasource
Next
From: Jun KAWAI
Date:
Subject: Re: md5 authentication bug?