Martin Jericho wrote:
> I need to process queries containing millions of
> records in a Java application, and found the only
> way to do this without the JDBC driver storing the
> entire result in memory is by using the
> statement.setFetchSize(Integer.MIN_VALUE) feature
> mentioned in the documentation:
>
http://dev.mysql.com/doc/connector/j/en/cj-impleme
> ntation-notes.html
>
> The documentation mentions a caveat that "any
> tables referenced by the query that created the
> streaming result will be locked until all of the
> results have been read or the connection closed".
>
> I have experimented with this feature and have
> found that I can in fact add, delete and update
> rows in the table being accessed by the query
> while the query is still open, as long as I do it
> from a different connection. So what it the
> documentation talking about when it says the table
> is locked? Is the documentation wrong?
>
> Thanks for any help on this.
This is true for MyISAM tables in most cases. Are you using MyISAM or InnoDB tables?
-Mark
Mark Matthews
Consulting Member Technical Staff - MySQL Enterprise Tools
Oracle
http://www.mysql.com/products/enterprise/monitor.html