db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From TomohitoNakayama <tomon...@basil.ocn.ne.jp>
Subject Re: [jira] Updated: (DERBY-721) State of InputStream retrieved from resultset is not clean , if there exists previous InputStream .
Date Tue, 06 Dec 2005 10:20:51 GMT

Mike Matrigali wrote:

> I am new to this issue and have not reviewed the patch yet.  I am just 
> trying to understand what the correct behavior is.  If this has
> already been discussed feel free to point that out.I know Sunitha 
> submitted some fixes in this area, but she will not be able to look
> at these for awhile.
> In your test it is obvious that the first instance of the stream can
> not be used anymore since you use the same variable.  What if the
> test instead did:
> InputStream is1 = rs.getBinaryStream(1);
> System.out.println("Here goes first stream");
> System.out.println(is1.read());
> System.out.println(is1.read());
> System.out.println(is1.read());
> InputStream is2 = rs.getBinaryStream(1);
> System.out.println("Here goes 2nd stream");
> System.out.println(is2.read());
> System.out.println(is2.read());
> System.out.println(is2.read());
> System.out.println("Here goes first stream continuing");
> System.out.println(is1.read());
> System.out.println(is1.read());
> System.out.println(is1.read());

As Daniel told already, is1 is closed when 2nd call of getBinaryStream.

> Also if you have not done so, please always test a short blob (ie. 
> something shorter than 4k and a long blob (something longer than
> 32k or whatever is the page size of the table being used).  There
> are 2 very different paths through the code, depending on size of
> the datatypes.  In the short case they are passed around in memory
> as a single object and in the long case there is an underlying
> stream that should only be read once.  I believe the new test covers
> a lot of these cases.

I see .
I will add the test pattern for different size lob.

Best regards.


        Tomohito Nakayama



View raw message