db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas Dudziak <tom...@gmail.com>
Subject Re: PostgreSQL default JDBC fetch size hint
Date Thu, 14 Apr 2005 18:09:58 GMT
On 4/14/05, Martin Kalén <mkalen@apache.org> wrote:
> Greetings,
>   on the user list Andreas Bohnert has pointed out some memory problems
> when using the PostgreSQL JDBC driver and a large ResultSet, since
> the PostgreSQL JDBC client will fetch _all_ returned rows over the wire
> even when the ResulSet is iterated one row at a time with eg
> OJB getIteratorByQuery.
> See this thread:
>   http://www.mail-archive.com/ojb-user%40db.apache.org/msg13380.html
> I have done some testing and it seems that explicit setting of the
> fetch size (a JDBC hint most drivers will ignore) does not cause
> any trouble with the OJB tests. See PB and ODMG results here:
>   http://people.apache.org/~mkalen/ojb/postgresql-fetchsize-tests.html
> However, making fetchSize=1 a global PostgreSQL default in OJB will
> probably cause slightly more network traffic and JDBC overhead so
> there might be objections to checking in the new afterStatementCreate
> shown on my ASF webpage above.
> Any thoughts/comments on this?

How about adding a fetchSize attribute to the JdbcConnectionDescriptor
and perhaps also to the query ? This way, the fetch size is tunable
for jdbc drivers that support this. Any JDBC driver should implement
this method (its defined since JDBC 1.2) regardless of whether it
actually does something.
Also, we should perhaps have a reasonable default, e.g. 50 or
something, for PostgreSQL ?!


To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org

View raw message