Re: JDBC Large ResultSet problem + BadTimeStamp Patch

From: Joseph Shraibman <jks(at)selectacast(dot)net>
To: Peter Mount <peter(at)retep(dot)org(dot)uk>, "pgsql-interfaces(at)postgreSQL(dot)org" <pgsql-interfaces(at)postgreSQL(dot)org>
Subject: Re: JDBC Large ResultSet problem + BadTimeStamp Patch
Date: 2000-10-11 17:50:06
Message-ID: 39E4A84E.7741C8C6@selectacast.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-interfaces

Peter Mount wrote:
>
> On Wed, 11 Oct 2000, Michael Stephenson wrote:
>
> > Two things.
> >
> > Firstly, when dealing with a large ResultSet (about 120000 rows), I get a
> > null pointer exception on the line:
> > wasNullFlag = (this_row[columnIndex - 1] == null);
> > Whenever I call getString(), has anyone else had this? And does anybody
> > have a solution?
>
> Are you getting any out of memory errors at all?
>
> The problem with the current implementation is that it reads the entire
> result into memory, so 120000 rows may be filling up your VM's memory
> (defaults to about 16Mb).
>
> Does it occur if you add the -mx argument to java, ie:
>
> java -mx 64m uk.org.retep.sql.RetepSQL
>
> I'm in the design stage of implementing a version of ResultSet that will
> use cursors, to limit how much is loaded in memory at a time.
>

The problem with that is the same problem I ran into with locking.
cursors need to be in a BEGIN END block, and other calls from different
Statement objects using the same db connectioni will interfere. Make
sure it is clearly documented that that will not be thread safe (unless
postgres gets named locks by then).

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2000-10-11 18:01:02 TIOGA
Previous Message Peter Eisentraut 2000-10-11 16:47:47 Re: Small patch to replace 'idle' by 'trans' if transaction is still open

Browse pgsql-interfaces by date

  From Date Subject
Next Message David N. Welton 2000-10-11 18:07:01 Re: TCL API
Previous Message David Diller 2000-10-11 17:06:37 accessing arrays from jdbc