Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
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

pgsql-jdbc by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group