openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From MiƂosz Tylenda <>
Subject Re: Using FetchPlan.setFetchBatchSize() feature leads
Date Mon, 12 Sep 2011 18:15:12 GMT

It seems that setting openjpa.FetchBatchSize implicitly enables large result set support which
is not suitable for your case.

However, chances are you can execute Statement.setFetchSize(int) by extending the DBDictionary
you are using, although it needs some typing. As a guidance, see PostgresDictionary.decorate
method. It creates a wrapped Connection, which in turn provides wrapped PreparedStatements
where you can override methods like executeQuery and inject a call to setFetchSize. Or do
it in prepareStatement method of your wrapped Connection.

Let us know how it goes.


> How do I set fetch size in JPA? I would like the cursor to read 2000 rows at
> once to speed up entity generation. Thanks for help!
> --
> View this message in context:
> Sent from the OpenJPA Users mailing list archive at

View raw message