RE: Serious OutOfMemory issue while reading with mysql-connector-j-5.0.7 ...
"Mark Matthews" <[email protected]> Fri, 31 Aug 2007 08:50:09 -0500
| Newsgroups | gmane.comp.db.mysql.java |
|---|---|
| Message-ID | <002601c7ebd5$d98e6de0$9c1da8c0@marksworkbox> |
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 > -----Original Message----- > From: Paul Palaszewski [mailto:[email protected]] > Sent: Friday, August 31, 2007 5:35 AM > To: Mark Matthews > Cc: [email protected] > Subject: Re: Serious OutOfMemory issue while reading with > mysql-connector-j-5.0.7 ... > > Hi Mark! > > Big thanks for your detailed response. I've tested with Connector/J > 5.0.3 + 5.0.7 and debugged 5.0.7. [snip] > As you suggested, setting fetchSize to Integer.MIN_VALUE > fixed the OutOfMemoryException. During my first the debug > session I've seen the MIN_VALUE, but I've had a look at the > javadoc for setFetchSize which states ... > * @exception SQLException if a database access error > occurs, or the > * condition 0 <= <code>rows</code> <= > <code>this.getMaxRows()</code> > * is not satisfied. > * @since 1.2 > > So I would never have tried setting something which should > cause a SQLException. I've assumed, that the MIN_VALUE is > only used internally. > Does anyone have ideas, how this could be made more intuitive > without breaking compatibility? Hi Paul, The JDBC-compliant way to do this is to cast your statement to com.mysql.jdbc.Statement and call .enableStreamingResults() on it. (The JDBC spec states that "vendor extensions" can be created by adding methods to the JDBC interface.) If you're using a connection pool, there's usually a method to get to the "underlying" connection to use such methods. -Mark - -- Mark Matthews, Architect (Client Connectivity) MySQL, Inc. Chicago, USA - www.mysql.com -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (MingW32) iD8DBQFG2ByQtvXNTca6JD8RAlAHAJ4nLSB+whi/Ras/FwurBqYpadTUjQCgsBn/ fTSyvE9z85ZD0hbC3bctfkA= =x2Ov -----END PGP SIGNATURE----- -- MySQL Java Mailing List For list archives: http://lists.mysql.com/java To unsubscribe: http://lists.mysql.com/[email protected]