Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 24242 invoked from network); 6 Dec 2005 10:17:47 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 6 Dec 2005 10:17:47 -0000 Received: (qmail 37792 invoked by uid 500); 6 Dec 2005 10:17:45 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 37731 invoked by uid 500); 6 Dec 2005 10:17:44 -0000 Mailing-List: contact derby-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: Delivered-To: mailing list derby-dev@db.apache.org Received: (qmail 37721 invoked by uid 99); 6 Dec 2005 10:17:44 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 06 Dec 2005 02:17:44 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [222.146.51.83] (HELO smtp.basil.ocn.ne.jp) (222.146.51.83) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 06 Dec 2005 02:17:43 -0800 Received: from [192.168.0.8] (p4150-adsan11honb5-acca.tokyo.ocn.ne.jp [61.214.217.150]) by smtp.basil.ocn.ne.jp (Postfix) with ESMTP id EB5A5685D for ; Tue, 6 Dec 2005 19:17:21 +0900 (JST) Received: from 127.0.0.1 (AVG SMTP 7.1.371 [267.13.12/192]); Tue, 06 Dec 2005 19:20:53 +0900 Message-ID: <43956603.7010901@basil.ocn.ne.jp> Date: Tue, 06 Dec 2005 19:20:51 +0900 From: TomohitoNakayama User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923) X-Accept-Language: ja, en-us, en MIME-Version: 1.0 To: derby-dev@db.apache.org Subject: Re: [jira] Updated: (DERBY-721) State of InputStream retrieved from resultset is not clean , if there exists previous InputStream . References: <1661600910.1133590410615.JavaMail.jira@ajax.apache.org> <4394781C.4020307@sbcglobal.net> In-Reply-To: <4394781C.4020307@sbcglobal.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Hello. 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 tomonaka@basil.ocn.ne.jp tomohito@rose.zero.ad.jp tmnk@apache.org Naka http://www5.ocn.ne.jp/~tomohito/TopPage.html */