Andreas Bohnert wrote:
Postgres (for example) don't use cursors on default. The PG jdbc driver loads the entire ResultSet all at once and keeps it in memory! So, even if you do a getIteratorByQuery the memory load on a large resultset is huge!

You can get around this, if you set the fetchsize on the jdbc statement
for example:
           stmt = con.createStatement();
           stmt.setFetchSize(1);
           ResultSet rs = stmt.executeQuery(sql);

This actually forces the jdbc driver to use a cursor and browse the resultset one by one.

There is no possibility to do this with ojb's getIteratorByQuery! Or is there?

I had a look around, and you can currently not control this in OJB.

However, it is easy enough to issue this in the PostgreSQL-specific
platform driver but then it would apply to all created Statement
instances within OJB.

I will do some performance testing and run the regression test with vs.
without different setFetchSize settings in the PostgreSQL platform
and see if it qualifies as a new PostgreSQL default behaviour.
Any heads-up comments on this?

Regards,
 Martin

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to