openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rick Curtis <>
Subject Re: Large result set problem on MySQL
Date Tue, 14 Apr 2009 18:49:04 GMT

Is this a problem that we want to make a code change for, or do we want to update the user
manual stating that this is a known MySQL limitation?

I vote for updating the known limitations since I haven't found this problem reported before
and it seems to have always existed.


>From [2] -- "The combination of a forward-only, read-only result set, with a fetch size
of Integer.MIN_VALUE  serves as a signal to the driver to stream result sets row-by-row. After
this any result sets created with the statement will be retrieved row-by-row. "

To verify that the results are streaming I execute "SELECT * FROM EntityOne" from a table
that has 1.5 million rows and iterate over the results. Since this operation doesn't cause
an OOM, I know it is streaming.

Hi Rick! What are you asking the statement to do
when you set fetch size to a negative number? How
are you verifying what result sets are doing?
Joe Weinstein

At 09:54 AM 4/10/2009, Rick Curtis wrote:

>Yesterday I was looking into large result sets and it appears that they don't work as
implemented/documented(?). I did some googling around [1] and found a number of posts talking
about how setFetchSize isn't being honored, some dating back as far as 2002. The MySQL docs
[2] states "When using versions of the JDBC driver earlier than 3.2.1, and connected to server
versions earlier than 5.0.3, the setFetchSize() method has no effect, other than to toggle
result set streaming as described above.". The doc outlines some additional instructions on
how to create a statement that is going to allow a streaming result set. After moving to a
newer JDBC driver, I wrote a simple test using JDBC and it does work properly. Below is a
snippet of the code [3] that I used to test this with JDBC, but I wasn't able to figure out
how to make OpenJPA do the same.
>Any thoughts/suggestions?
>[1] Google "mysql jdbc setFetchSize"
>stmt = conn.createStatement(java.sql.ResultSet.TYPE_FORWARD_ONLY,java.sql.ResultSet.CONCUR_READ_ONLY);
>View this message in context:
>Sent from the OpenJPA Developers mailing list archive at
>Notice:  This email message, together with any attachments, may contain information  of
 BEA Systems,  Inc.,  its subsidiaries  and  affiliated entities,  that may be confidential,
 proprietary,  copyrighted  and/or legally privileged, and is intended solely for the use
of the individual or entity named in this message. If you are not the intended recipient,
and have received this message in error, please immediately return this by email and then
delete it.

View this message in context:
Sent from the OpenJPA Developers mailing list archive at

View raw message