HELP: How to tame the 8.3.x JDBC driver with a biq query result set

From: Dave Crooke <dcrooke(at)gmail(dot)com>
To: pgsql-jdbc(at)postgresql(dot)org
Subject: HELP: How to tame the 8.3.x JDBC driver with a biq query result set
Date: 2010-04-15 20:13:39
Message-ID: t2gca24673e1004151313x66d090c6q36193d18f4ec2d67@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

I have a huge table I need to do a full table scan on.

I have tried it both ways:

1. With vanilla JDBC, the PG driver tries to suck up the entire result set,
and crashes the JVM with java.lang.OutOfMemory

2. When I use setFetchSize(), which is both a JDBC standard and the
recommendation on the page below ...

http://jdbc.postgresql.org/documentation/83/query.html#query-with-cursor

... it bails after about 900ms / 100 fetches / a few thousand rows, with the
following PG internal error:

13:59:55,346 [PerfDataMigrator] FATAL
com.hyper9.storage.sample.persistence.PersistenceManager:3064 - hPDM()
13:59:56,054 [PerfDataMigrator] ERROR
com.hyper9.storage.sample.persistence.PersistenceManager:3216 - Unexpected
error while migrating sample data: 6000
org.postgresql.util.PSQLException: ERROR: portal "C_14" does not exist
at
org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:1592)
at
org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1327)
at
org.postgresql.core.v3.QueryExecutorImpl.fetch(QueryExecutorImpl.java:1527)
at
org.postgresql.jdbc2.AbstractJdbc2ResultSet.next(AbstractJdbc2ResultSet.java:1843)
at
org.apache.commons.dbcp.DelegatingResultSet.next(DelegatingResultSet.java:169)
at
org.apache.commons.dbcp.DelegatingResultSet.next(DelegatingResultSet.java:169)
at
com.hyper9.storage.sample.persistence.PersistenceManager$Migrator.run(PersistenceManager.java:3156)
at java.lang.Thread.run(Thread.java:619)

Does anyone know of a workaround? Is this bug fixed in a newer release?

Cheers
Dave

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Kris Jurka 2010-04-15 20:22:27 Re: HELP: How to tame the 8.3.x JDBC driver with a biq query result set
Previous Message Ader Javier 2010-04-12 20:17:42 Re: It is safe remenber current Isolation level in AbstractJdbc2Connection?