db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel John Debrunner <...@debrunners.com>
Subject Re: [jira] Updated: (DERBY-721) State of InputStream retrieved from resultset is not clean , if there exists previous InputStream .
Date Mon, 05 Dec 2005 20:20:09 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());

The second call to getBinaryStream is required to close the first stream.

Dan.


Mime
View raw message