X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id F3ED25388D for ; Fri, 29 Apr 2005 05:04:37 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 51888-06 for ; Fri, 29 Apr 2005 08:04:37 +0000 (GMT) Received: from mail63.csoft.net (leary3.csoft.net [63.111.22.74]) by svr1.postgresql.org (Postfix) with SMTP id 868EF538A5 for ; Fri, 29 Apr 2005 05:04:36 -0300 (ADT) Received: (qmail 20731 invoked by uid 1112); 29 Apr 2005 08:04:34 -0000 Date: Fri, 29 Apr 2005 03:04:34 -0500 (EST) From: Kris Jurka X-X-Sender: books@leary.csoft.net To: Antony Paul Cc: PostgreSQL JDBC Subject: Re: Impact of open ResultSets and PreparedStatements ? In-Reply-To: <2989532e0504260624230facf6@mail.gmail.com> Message-ID: References: <2989532e0504260624230facf6@mail.gmail.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.011 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200504/209 X-Sequence-Number: 12816 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