Briggs wrote:
Thank you so much.  I guess I should have mentioned I was using jdk 6.
With Sun jdk 1.6 I was able to reproduce the OutOfMemory error and Øystein was right; it does look like DERBY-3354. You were not seeing it with embedded because you never made a getBlob() or getObject() call which is what triggers the bug. For Network Server that call happens under the covers.

There are a couple of workarounds that I can think of.
1) commit every 1000 rows or so.
    for(int i = 0; rs.next(); i++) {
           System.out.println("Read: " + i + " records.");
       if (i % 1000 == 0)
       conn.commit();
       }

2) do a getBlob and a free. This will work for network server but not embedded where it would still leak if you do a getBlob().
      for(int i = 0; rs.next(); i++) {
           System.out.println("Read: " + i + " records.");
       Blob b = rs.getBlob(1);
       b.free();
       }

HTH

Kathey




Reply via email to