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?
Have a look at http://issues.apache.org/jira/browse/OJB-31
This is now fixed (in beta state) in the OJB_1_0_RELEASE branch,
where you can set a global max cap hint through the connection-pool
descriptor in your repository.
All Iterator objects should also set fetchSize hints of 1 internally
in OJB -- so please give it a try without setting any hint at first,
and see if you get better results automagically.
Regards,
Martin
P.S. This will also be merged with the trunk (v1.1 pre) eventually.
I will re-open the issue in JIRA and set the status there once it
has been done so you can add yourself as observer of OJB-31 in JIRA
to get mail notification on updates.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]