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 E6178536C8 for ; Fri, 29 Apr 2005 06:46:39 -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 64372-04 for ; Fri, 29 Apr 2005 09:46:30 +0000 (GMT) Received: from wproxy.gmail.com (wproxy.gmail.com [64.233.184.199]) by svr1.postgresql.org (Postfix) with ESMTP id 305895368F for ; Fri, 29 Apr 2005 06:46:29 -0300 (ADT) Received: by wproxy.gmail.com with SMTP id 68so927249wri for ; Fri, 29 Apr 2005 02:46:32 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=X/ZeuiMTnsWzt+B0Xu5bDpRT97O9sWyv3ZIObpZGVS8lqG5EujP0GU5xpmyl1RRaBNwo4P4lgRQhfpB+1uKWqeP8UnHQn6zHOFQjHnKtTBYNtyt6VFEhiAEKlgZsP58Lx6oIZpTgOESYdApFV67OvD2oEc6v6jFchQilVXOFZ/w= Received: by 10.54.121.2 with SMTP id t2mr1255961wrc; Fri, 29 Apr 2005 02:46:32 -0700 (PDT) Received: by 10.54.31.54 with HTTP; Fri, 29 Apr 2005 02:46:32 -0700 (PDT) Message-ID: <2989532e050429024652aca0be@mail.gmail.com> Date: Fri, 29 Apr 2005 15:16:32 +0530 From: Antony Paul Reply-To: Antony Paul To: PostgreSQL JDBC , Kris Jurka Subject: Re: Impact of open ResultSets and PreparedStatements ? In-Reply-To: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <2989532e0504260624230facf6@mail.gmail.com> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.771 tagged_above=0 required=5 tests=AWL, DNS_FROM_RFC_ABUSE, FROM_ENDS_IN_NUMS, RCVD_BY_IP X-Spam-Level: X-Archive-Number: 200504/211 X-Sequence-Number: 12818 On 4/29/05, Kris Jurka wrote: >=20 >=20 > On Tue, 26 Apr 2005, Antony Paul wrote: >=20 > > 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 ?. >=20 > It depends there are two types of PreparedStatements and two types of > ResultSets each one has a version that takes no permanent server resource= s > 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. >=20 > Kris Jurka >=20 >=20 Thanks for the reply.=20 I am using PostgreSQL 7.3 (server and JDBC driver) and no stored procedures are used but uses the built in functions. I know that in this version PreparedStatements are not kept in the server. What about the ResultSet ?. Does all the data is transferred to application right after the query is executed or only a predefined no of records are returned while going through the rs.next() call ?. --=20 rgds Antony Paul http://www.geocities.com/antonypaul24/