Re: OutOfMemory

From: Oliver Jowett <oliver(at)opencloud(dot)com>
To: Guido Fiala <guido(dot)fiala(at)dka-gmbh(dot)de>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: OutOfMemory
Date: 2004-04-01 08:09:32
Message-ID: 406BCE3C.90804@opencloud.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Guido Fiala wrote:
> Am Donnerstag, 1. April 2004 09:14 schrieb Oliver Jowett:
> [...]
>
>>>st=conn.createStatement(ResultSet.TYPE_FORWARD_ONLY,ResultSet.CONCUR_READ
>>>_ONLY); st.setFetchSize(1);
>>> ResultSet rs=st.executeQuery("Select * from tst_fetchsize");
>>> rs.last();//now we should be at "count"
>>
>>Indeed, here's your problem -- you're not allowed to call last() on a
>>TYPE_FORWARD_ONLY resultset. The driver should throw an exception at
>>this point (but currently doesn't). See the ResultSet.last() javadoc for
>>details.
>
>
> Ok - that's one part, but why does the second part of my testcase not work as
> expected - means fetchsize has no effect ?

This is the part where you use TYPE_SCROLL_SENSITIVE + setFetchsize()
and see the driver pulling the whole resultset into memory at once?

setFetchsize() is a hint. As no-one has implemented cursor-backed
support for scrollable resultsets yet, the driver ignores the hint and
fetches the whole result set anyway.

Patches to improve this behaviour are, of course, welcome :)

-O

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Oliver Jowett 2004-04-01 08:54:22 testGetTimeZone failures using CVS driver
Previous Message Guido Fiala 2004-04-01 07:51:10 Re: OutOfMemory