Re: Impact of open ResultSets and PreparedStatements ? - Mailing list pgsql-jdbc

From Kris Jurka
Subject Re: Impact of open ResultSets and PreparedStatements ?
Date
Msg-id Pine.BSO.4.56.0504290302170.3380@leary.csoft.net
Whole thread Raw
In response to Impact of open ResultSets and PreparedStatements ?  (Antony Paul <antonypaul24@gmail.com>)
Responses Re: Impact of open ResultSets and PreparedStatements ?
List 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


pgsql-jdbc by date:

Previous
From: Kris Jurka
Date:
Subject: Re: Interval support for Postgres
Next
From: Kris Jurka
Date:
Subject: Re: CallableStatement problem...?