On May 18, 2009, at 4:10 AM, Mark Addleman wrote:
The problem is likely in the MySQL's JDBC driver. Some retrieve the entire result set from the database on statement execute while others are more true to the notion of a remote database cursor. The JDBC API has a workaround for this problem: Use Statement.setFetchSize(int) to limit the number of rows the JDBC driver will try to retrieve from the database at any one time.
Thanks, Mark. There's some interesting discussion here: http://bugs.mysql.com/bug.php?id=18148 and here: http://www.google.com/search?q=mysql+streamingJDBC supports optional parameters for creating Statements. Using them, one can communicate with the MySQL driver that the results should be streamed rather than cached all at once.
I'm working on allowing clojure.contrib.sql users to specify these options.
--Steve
smime.p7s
Description: S/MIME cryptographic signature