db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Briggs <acidbri...@gmail.com>
Subject Re: Iterating through large result set in network mode causes OutOfMemoryException
Date Mon, 11 Feb 2008 16:02:50 GMT
Well, unfortunately, freeing the Blob didn't work, the app still runs
out of memory.

Also, the occasional commit is also causing a problem.  I end up
eventually getting this:

java.sql.SQLException: The data in this BLOB or CLOB is no longer
available.  The BLOB/CLOB's transaction may be committed, or its
connection is closed.

I am trying to figure out what could be causing this, it works in the
test case, but fails pretty darn quick in my application.  Very very
strange.





On Feb 8, 2008 11:26 PM, Briggs <acidbriggs@gmail.com> wrote:
> Hey, again, thanks!   Will try it out.
>
>
> On Feb 8, 2008 7:19 PM, Kathey Marsden <kmarsdenderby@sbcglobal.net> wrote:
> > 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
> >
> >
> >
> >
> >
>
>
>
>
> --
> "Conscious decisions by conscious minds are what make reality real"
>



-- 
"Conscious decisions by conscious minds are what make reality real"

Mime
View raw message