X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.192]) by svr1.postgresql.org (Postfix) with ESMTP id 189B6CCA83 for ; Thu, 17 Jul 2003 17:40:33 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (svr4.postgresql.org [64.117.224.192]) (amavisd-new, port 10024) with ESMTP id 21774-02 for ; Thu, 17 Jul 2003 17:40:57 +0000 (GMT) Received: from exchange.hq.openratings.com (unknown [141.149.165.226]) by svr1.postgresql.org (Postfix) with ESMTP id 5ED41CCA46 for ; Thu, 17 Jul 2003 14:40:27 -0300 (ADT) Received: from openratings.com (cancun.hq.openratings.com [10.0.0.225]) by exchange.hq.openratings.com with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2653.13) id 38QM4V2S; Thu, 17 Jul 2003 13:40:57 -0400 Message-ID: <3F16DFC7.3090305@openratings.com> Date: Thu, 17 Jul 2003 13:41:27 -0400 From: Dmitry Tkach User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) Gecko/20021130 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Felipe Schnack Cc: Rich Cullingford , pgsql-jdbc@postgresql.org Subject: Re: setFetchSize() References: <3F16D2C9.3010808@sysd.com> <3F16D677.3010300@openratings.com> <20030717140110.52ca5fe2.felipes@ritterdosreis.br> <3F16D9DF.6050900@openratings.com> <20030717141903.2cf411e2.felipes@ritterdosreis.br> <3F16DC24.5020509@openratings.com> <20030717143140.722d8bf1.felipes@ritterdosreis.br> In-Reply-To: <20030717143140.722d8bf1.felipes@ritterdosreis.br> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200307/102 X-Sequence-Number: 7486 Felipe Schnack wrote: > Yes, I understand that... that's why I asked why the JDBC driver doesn't automatically use cursos when you have autocommit off and a fetch size > > Because it was never implemented, I suppose... Here is what 7.3 code looks like: public void setFetchSize(int rows) throws SQLException { throw org.postgresql.Driver.notImplemented(); } :-) Dima >On Thu, 17 Jul 2003 13:25:56 -0400 >Dmitry Tkach wrote: > > > >>Felipe Schnack wrote: >> >> >> >>> but I said I can't understand it when autocommit is off, not when it's on... >>> >>> >>> >>autocommit is off == you are in transaction. >> >>You must be in transaction to be able to declare a cursor. >> >>Dima >> >> >> >>>On Thu, 17 Jul 2003 13:16:15 -0400 >>>Dmitry Tkach wrote: >>> >>> >>> >>> >>> >>>>Felipe Schnack wrote: >>>> >>>> >>>> >>>> >>>> >>>>>Seems to me like a quite good solution! But why this is needed when autocommit is off? I can't understand. >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> >>>>Because you can only have cursors declared inside a transaction :-( >>>> >>>>Dima >>>> >>>> >>>> >>>> >>>> >>>>>On Thu, 17 Jul 2003 13:01:43 -0400 >>>>>Dmitry Tkach wrote: >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> >>>>>>Rich Cullingford wrote: >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> >>>>>>>All, >>>>>>>Will this function be implemented in Release 7.4? I have several arge >>>>>>>tables that run Java out of memory when I attempt to load them through >>>>>>>JDBC. Any workarounds arppreciated... >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>I was using cursors for a while as a workaround... >>>>>>Something like this: >>>>>> >>>>>>c.setAutocommit (false); >>>>>>Statement s = c.createStatement (); >>>>>>s.execute ("declare foo cursor for select * from bar"); >>>>>> >>>>>>while (true) >>>>>>{ >>>>>> ResultSet rs = s.executeQuery ("fetch 10 from foo"); >>>>>> int count = 0; >>>>>> while (rs.next ()) >>>>>> { >>>>>> count++; >>>>>> doStuffWithThisRow (rs); >>>>>> } >>>>>> >>>>>> if (count < 10) //The whole cursor contents has been processed >>>>>> break; >>>>>>} >>>>>> >>>>>> >>>>>>I hope, it helps... >>>>>> >>>>>>Dima >>>>>> >>>>>> >>>>>> >>>>>>---------------------------(end of broadcast)--------------------------- >>>>>>TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> >>>>> >>>>> >>>>> >>>>> >>>> >>>> >>>> >>>> >>> >>> >>> >>> >> >>---------------------------(end of broadcast)--------------------------- >>TIP 2: you can get off all lists at once with the unregister command >> (send "unregister YourEmailAddressHere" to majordomo@postgresql.org) >> >> > > > >