pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Shawn Heisey <pgsql@elyograg.org>
To: pgsql-jdbc@postgresql.org
Subject: Forcing cursor behavior
Date: Mon, 20 Jul 2009 20:14:36 -0600
Message-ID: <4A65248C.8040406@elyograg.org> (raw)

I have been scouring everything I can find trying to get my problem 
solved.  I've turned up a number of discussions, but nothing so far that 
does what I want.

I've got a java application, to which I cannot get source code, that 
needs to process a query with two million rows in it, out of 35 million 
total.  Currently we use it with another database, and we are trying to 
migrate to Postgres.  I've got it talking to the database via your 
driver, but it runs out of memory because the driver works as designed 
and tries to return the entire query at once.  If I could modify the 
program, then I could just turn off autocommit, set the fetchsize, and 
everything would be well, but that's not an option.

I want to modify the driver to force the cursor behavior with a 
fetchsize of 10,000 rows.  The program does not modify the database, so 
I don't need to worry about autocommit.  I've tried changing the code in 
every place that I can find, but haven't had any luck.  It still 
compiles and works, but exactly the same way it did before.  I have some 
experience with code, but my work experience is admin, not programming.  
I have no specific experience with Java.

Would it be possible to patch the jdbc driver so that it will internally 
turn autcommit off, set the fetchsize to 10,000, and ignore any attempt 
by the application to change these parameters?  Could someone create 
such a patch for me? I am using java 1.5, so the driver compiles as the 
3g version.




view thread (5+ messages)  latest in thread

Message-ID: <4A65248C.8040406@elyograg.org>
Permalink:  ../4A65248C.8040406@elyograg.org/
Also on:    postgresql.org/message-id/4A65248C.8040406@elyograg.org

 · 

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: pgsql@elyograg.org
  Subject: Re: Forcing cursor behavior
  In-Reply-To: <4A65248C.8040406@elyograg.org>
  References: <4A65248C.8040406@elyograg.org>

* 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