cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrus Adamchik (JIRA)" <j...@apache.org>
Subject [jira] [Closed] (CAY-2014) Ensure SelectQuery.setFetchSize() actually takes affect on MySQL
Date Mon, 15 Jun 2015 13:31:00 GMT

     [ https://issues.apache.org/jira/browse/CAY-2014?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Andrus Adamchik closed CAY-2014.
--------------------------------
    Resolution: Not A Problem

Ah great. So we don't need to do anything special in Cayenne. Just set "useCursorFetch=true"
in MySQL. Thanks for the research.

> Ensure SelectQuery.setFetchSize() actually takes affect on MySQL
> ----------------------------------------------------------------
>
>                 Key: CAY-2014
>                 URL: https://issues.apache.org/jira/browse/CAY-2014
>             Project: Cayenne
>          Issue Type: Improvement
>            Reporter: Andrus Adamchik
>            Assignee: Andrus Adamchik
>
> We supported SelectQuery.setFetchSize() since times immemorial, however it doesn't do
much on MySQL. According to [1] MySQL still reads the entire ResultSet in memory. So whenever
a query has fetch size set, we need to ensure that MySQL adapter creates PreparedStatement
using the following parameters (also from [1]) :
> {noformat}stmt = conn.createStatement(java.sql.ResultSet.TYPE_FORWARD_ONLY,
>               java.sql.ResultSet.CONCUR_READ_ONLY);
> stmt.setFetchSize(Integer.MIN_VALUE);
> {noformat}
> For a bonus point, we'll need to research whether other DBs (PostgreSQL, Oracle, SQLServer)
actually support fetch size or whether they require special handling like MySQL.
> [1] http://dev.mysql.com/doc/connector-j/en/connector-j-reference-implementation-notes.html



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message