Re: OutOfMemory hibernate scroll with 2M records | Postgresql 8.4 DB

From: "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
To: <gsstark(at)mit(dot)edu>,<craig(at)postnewspapers(dot)com(dot)au>
Cc: <pgsql-bugs(at)postgresql(dot)org>,<ankitk(at)xebia(dot)com>
Subject: Re: OutOfMemory hibernate scroll with 2M records | Postgresql 8.4 DB
Date: 2009-12-22 15:37:22
Message-ID: 4B309352020000250002D8BA@gw.wicourts.gov
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Craig Ringer wrote:
> Greg Stark wrote:
>> Ankit Kumar wrote:
>>> Thanks for your response. Hibernate works well when I change the
>>> DB to SQL server but somehow the moment I point to Postgresql it
>>> start generating OutOfMemory. Is there some configuration at DB
>>> end to ensure it starts using the cursors.
>>
>> No Postgresql is not generating these errors -- they're Java
>> errors and Postgresql is not written in Java.
>
> However, PostgreSQL's JDBC driver *is*.

Yeah, and PostgreSQL is unique among the database products I've used
in defaulting to materializing the entire result set on the client
side before returning from the execute call. Most databases fire off
the query on the server at execute and wait for client requests to
pull data before generating the result rows on the server side (maybe
with a small read-ahead for performance). It would appear that
hibernate, at least as configured and used here, is not overcoming
this default PostgreSQL behavior.

Take a look at this page and see where it might be going wrong:

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

-Kevin

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Dave Page 2009-12-22 15:38:06 Re: BUG #5250: Tutorial examples(pre-compiled) not present with precompiled binary version of PostgreSQL.
Previous Message Ashish Anand 2009-12-22 15:30:46 Re: BUG #5250: Tutorial examples(pre-compiled) not present with precompiled binary version of PostgreSQL.