patch: add a finalizer to AbstractJdbc1Statement

From: Oliver Jowett <oliver(at)opencloud(dot)com>
To: pgsql-jdbc(at)postgresql(dot)org
Subject: patch: add a finalizer to AbstractJdbc1Statement
Date: 2003-08-17 14:00:31
Message-ID: 20030817140030.GC18710@opencloud.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

This patch adds a finalizer to AbstractJdbc1Statement that closes the
statement. Without this, when server-side preparation is in use statements
that are executed then discarded without an explicit close() will leak
resources on the backend while that connection remains open, as a DEALLOCATE
never gets executed.

Objects with a finalizer are more expensive to create (depending on the VM).
If it's too much of a price to pay in the general case, there's another
approach that uses phantom references and only pays the cost when backend
resources are actually allocated, but the code becomes much more complex.

-O

Attachment Content-Type Size
pgsql-statement_finalizer.txt text/plain 915 bytes

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Dave Cramer 2003-08-18 01:55:16 Re: [JDBC] Bug #926: if old postgresql.jar in CLASSPATH,
Previous Message Palle Girgensohn 2003-08-17 13:57:16 Re: Bug #926: if old postgresql.jar in CLASSPATH, ant fails