Re: Impact of open ResultSets and PreparedStatements ?

From: Kris Jurka <books(at)ejurka(dot)com>
To: Antony Paul <antonypaul24(at)gmail(dot)com>
Cc: PostgreSQL JDBC <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: Impact of open ResultSets and PreparedStatements ?
Date: 2005-04-29 08:04:34
Message-ID: Pine.BSO.4.56.0504290302170.3380@leary.csoft.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

On Tue, 26 Apr 2005, Antony Paul wrote:

> What will happen if I leave ResultSet and PreparedStatement not
> closed and I use a connection pool which is not closing the ResultSet
> and PreparedStatement. Will it cause resource leak in the server ?.

It depends there are two types of PreparedStatements and two types of
ResultSets each one has a version that takes no permanent server resources
and a version that does. A PreparedStatement may keep a permanent
prepared plan on the server and a ResultSet may be backed by a cursor
which also has server state. Its possible you can get away with it, but
it's best to close everything.

Kris Jurka

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Kris Jurka 2005-04-29 08:44:35 Re: CallableStatement problem...?
Previous Message Kris Jurka 2005-04-29 08:01:05 Re: Interval support for Postgres