pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Felipe Schnack <felipes@ritterdosreis.br>
To: Dmitry Tkach <dmitry@openratings.com>
Cc: Rich Cullingford <rculling@sysd.com>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: setFetchSize()
Date: Thu, 17 Jul 2003 14:19:03 -0300
Message-ID: <20030717141903.2cf411e2.felipes@ritterdosreis.br> (raw)
In-Reply-To: <3F16D9DF.6050900@openratings.com>
References: <3F16D2C9.3010808@sysd.com>
	<3F16D677.3010300@openratings.com>
	<20030717140110.52ca5fe2.felipes@ritterdosreis.br>
	<3F16D9DF.6050900@openratings.com>

  but I said I can't understand it when autocommit is off, not when it's on...

On Thu, 17 Jul 2003 13:16:15 -0400
Dmitry Tkach <dmitry@openratings.com> 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 <dmitry@openratings.com> 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
> >>    
> >>
> >
> >
> >  
> >
> 
> 


-- 

 /~\ The ASCII        Felipe Schnack (felipes@ritterdosreis.br)
 \ / Ribbon Campaign  Analista de Sistemas
  X  Against HTML     Cel.: 51-91287530
 / \ Email!           Linux Counter #281893

Centro Universitário Ritter dos Reis
http://www.ritterdosreis.br
ritter@ritterdosreis.br
Fone: 51-32303341



view thread (40+ messages)  latest in thread

Message-ID: <20030717141903.2cf411e2.felipes@ritterdosreis.br>
Permalink:  ../20030717141903.2cf411e2.felipes@ritterdosreis.br/
Also on:    postgresql.org/message-id/20030717141903.2cf411e2.felipes@ritterdosreis.br

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: felipes@ritterdosreis.br, dmitry@openratings.com, rculling@sysd.com
  Subject: Re: setFetchSize()
  In-Reply-To: <20030717141903.2cf411e2.felipes@ritterdosreis.br>
  References: <3F16D2C9.3010808@sysd.com> <3F16D677.3010300@openratings.com> <20030717140110.52ca5fe2.felipes@ritterdosreis.br> <3F16D9DF.6050900@openratings.com> <20030717141903.2cf411e2.felipes@ritterdosreis.br>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox