ResultSet & setFetchSize fails to stop heap failures

Поиск
Список
Период
Сортировка
От U. George
Тема ResultSet & setFetchSize fails to stop heap failures
Дата
Msg-id 483DADFB.7010204@gatworks.com
обсуждение исходный текст
Ответы Re: ResultSet & setFetchSize fails to stop heap failures  (Kris Jurka <books@ejurka.com>)
Список pgsql-jdbc
The resultset is a very large  set of rows  ( each row 2 ints and a
bunch of doubles ) .  I am unable to  convince jdbc to fetch one row at
a time, and avoid the heap failure.
Is there a way, or just a bug, or feature deficiency?

        String s = "Select tzids, tzide, latlonpoints from " + tableName;
        ResultSet rSet;
        try {
            Statement select = sqlConnection.createStatement(
ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY);
            select.setFetchSize( 1 );
            rSet = select.executeQuery(s);      <==========================
            rSet.setFetchSize(1);
        } catch ( Exception e ) { e.printStackTrace(); rSet = null; }



Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
        at
org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1309)
        at
org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:192)
        at
org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:451)
        at
org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:336)
        at
org.postgresql.jdbc2.AbstractJdbc2Statement.executeQuery(AbstractJdbc2Statement.java:235)
        at UpdateNodeNumbers.getAllTzid(UpdateNodeNumbers.java:78)
        at UpdateNodeNumbers.<init>(UpdateNodeNumbers.java:34)
        at TestShapefile.test(TestShapefile.java:63)
        at TestShapefile.main(TestShapefile.java:50)



В списке pgsql-jdbc по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: [HACKERS] How embarrassing: optimization of a one-shot query doesn't work
Следующее
От: Kris Jurka
Дата:
Сообщение: Re: ResultSet & setFetchSize fails to stop heap failures