cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Gentry <blackn...@gmail.com>
Subject MySQL + Iterated/Streamed Query
Date Sat, 14 Mar 2020 14:31:25 GMT
I'm trying to do an iterated query (using the 4.1 RC) against MySQL and it
appears that the MySQL JDBC driver loads everything into memory first
instead of streaming results.  This results in memory-related exceptions
for larger results.

>From searching, it appears that the MySQL JDBC driver needs the following
hint to stream results:

statement =
connection.createStatement(java.sql.ResultSet.TYPE_FORWARD_ONLY,
java.sql.ResultSet.CONCUR_READ_ONLY);
statement.setFetchSize(Integer.MIN_VALUE);

Is there an easy way to get the iterated query to provide that hint when
getting a connection?  I've not found a way yet.  Best I've found so far is
to swap out a whole slew of classes to change the DataSource that's
actually returned.

Thanks,

mrg

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message