pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Forcing use of cursor for large result sets
2+ messages / 2 participants
[nested] [flat]

* Forcing use of cursor for large result sets
@ 2004-06-06 05:34  Brian G. Huber <brianghuber@yahoo.com>
  0 siblings, 1 reply; 2+ messages in thread

From: Brian G. Huber @ 2004-06-06 05:34 UTC (permalink / raw)
  To: pgsql-jdbc

Hello all - 

I am attempting to force the use of a cursor for a resultset.  I have tried both forward-only and scrollable statements and am setting fetch size to 100 with a call to setFechSize(100) on the statement.  However, I do not think a cursor is being used because the entire result set is trying to cache, resulting in an outofMemoryError.  I am using pg74.213.jdbc3.jar with 7.4.2.

Any advice appreciated... Thanks-
BGH

^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: Forcing use of cursor for large result sets
@ 2004-06-07 07:50  Kris Jurka <books@ejurka.com>
  parent: Brian G. Huber <brianghuber@yahoo.com>
  0 siblings, 0 replies; 2+ messages in thread

From: Kris Jurka @ 2004-06-07 07:50 UTC (permalink / raw)
  To: Brian G. Huber <brianghuber@yahoo.com>; +Cc: pgsql-jdbc



On Sun, 6 Jun 2004, Brian G. Huber wrote:

> Hello all - 
> 
> I am attempting to force the use of a cursor for a resultset.  I have
> tried both forward-only and scrollable statements and am setting fetch
> size to 100 with a call to setFechSize(100) on the statement.  However,
> I do not think a cursor is being used because the entire result set is
> trying to cache, resulting in an outofMemoryError.  I am using
> pg74.213.jdbc3.jar with 7.4.2.
> 

Two additional restrictions in the current driver are that you must be in 
a transaction by setting setAutoCommit(false) and that the query in 
question be a single sql statement.  The single statement test is a bit 
naive, so a semi-colon in the query string will make it think it is a 
multi-statement query.

Kris Jurka



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2004-06-07 07:50 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2004-06-06 05:34 Forcing use of cursor for large result sets Brian G. Huber <brianghuber@yahoo.com>
2004-06-07 07:50 ` Kris Jurka <books@ejurka.com>

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