X-Original-To: pgsql-general-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 1291C53785 for ; Thu, 24 Mar 2005 23:44:13 +0000 (GMT) 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 09096-04 for ; Thu, 24 Mar 2005 23:44:03 +0000 (GMT) Received: from mail63.csoft.net (leary3.csoft.net [63.111.22.74]) by svr1.postgresql.org (Postfix) with SMTP id D989153627 for ; Thu, 24 Mar 2005 23:44:02 +0000 (GMT) Received: (qmail 26730 invoked by uid 1112); 24 Mar 2005 23:44:05 -0000 Date: Thu, 24 Mar 2005 18:44:05 -0500 (EST) From: Kris Jurka X-X-Sender: books@leary.csoft.net To: David Gagnon Cc: pgsql-jdbc@postgresql.org, pgsql-general@postgresql.org Subject: Re: [JDBC] plpgsql function with RETURNS SETOF refcursor AS. How In-Reply-To: <42434D89.5080104@siunik.com> Message-ID: References: <42434D89.5080104@siunik.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.013 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200503/1233 X-Sequence-Number: 75548 On Thu, 24 Mar 2005, David Gagnon wrote: > I'm already able to get Refcursor from a stored procedure. But now I > need to get a SETOF refcursor and I can't make it work... Is that > possible to do this via JDBC? > > He is the code I did. The rsTmp.next() throws a Connection is > closed. Operation is not permitted. Exception. > > > rs = new ResultSet[j]; > System.arraycopy(tempArray, 0, rs, 0, j); > rsTmp.close(); System.arraycopy does not make a deep copy, so the rsTmp.close() closes the ResultSet. You really can't copy resources around like that. Consider how you would copy a Connection object. Does that establish a new connection? The underlying tcp/ip connection can't be copied. Kris Jurka