Return-Path: Delivered-To: apmail-db-derby-user-archive@www.apache.org Received: (qmail 76117 invoked from network); 4 Mar 2008 11:37:01 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 4 Mar 2008 11:37:01 -0000 Received: (qmail 32437 invoked by uid 500); 4 Mar 2008 11:36:55 -0000 Delivered-To: apmail-db-derby-user-archive@db.apache.org Received: (qmail 32415 invoked by uid 500); 4 Mar 2008 11:36:55 -0000 Mailing-List: contact derby-user-help@db.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: List-Id: Reply-To: "Derby Discussion" Delivered-To: mailing list derby-user@db.apache.org Received: (qmail 32404 invoked by uid 99); 4 Mar 2008 11:36:55 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 04 Mar 2008 03:36:55 -0800 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [192.18.19.6] (HELO sineb-mail-1.sun.com) (192.18.19.6) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 04 Mar 2008 11:36:07 +0000 Received: from fe-apac-02.sun.com (fe-apac-02.sun.com [192.18.19.173] (may be forged)) by sineb-mail-1.sun.com (8.13.6+Sun/8.12.9) with ESMTP id m24BaQYe003170 for ; Tue, 4 Mar 2008 11:36:30 GMT Received: from conversion-daemon.mail-apac.sun.com by mail-apac.sun.com (Sun Java System Messaging Server 6.2-6.01 (built Apr 3 2006)) id <0JX700401ES7R300@mail-apac.sun.com> (original mail from V.Narayanan@Sun.COM) for derby-user@db.apache.org; Tue, 04 Mar 2008 19:36:20 +0800 (SGT) Received: from [129.158.228.35] by mail-apac.sun.com (Sun Java System Messaging Server 6.2-6.01 (built Apr 3 2006)) with ESMTPSA id <0JX700ITBEWFP0E0@mail-apac.sun.com> for derby-user@db.apache.org; Tue, 04 Mar 2008 19:36:20 +0800 (SGT) Date: Tue, 04 Mar 2008 17:06:17 +0530 From: Narayanan Subject: Re: NPE getting length of Blob In-reply-to: <200803041607.55832.daniel@nuix.com> Sender: V.Narayanan@Sun.COM To: Derby Discussion Message-id: <47CD3431.5020205@sun.com> MIME-version: 1.0 Content-type: text/plain; format=flowed; charset=us-ascii Content-transfer-encoding: 7BIT References: <200803041607.55832.daniel@nuix.com> User-Agent: Thunderbird 2.0.0.6 (X11/20071022) X-Virus-Checked: Checked by ClamAV on apache.org Daniel Noll wrote: > Hi all. > > I have someone seeing the following error under both 10.3.1.4 and 10.3.2.1: > > java.lang.NullPointerException > at org.apache.derby.client.am.PreparedStatement.setIntX(Unknown Source) > at org.apache.derby.client.am.CallableLocatorProcedures.blobGetLength(Unknown > Source) > at org.apache.derby.client.am.Blob.getLocatorLength(Unknown Source) > at org.apache.derby.client.am.Lob.sqlLength(Unknown Source) > at org.apache.derby.client.am.Blob.length(Unknown Source) > > Has anyone seen something like this before? What is the cause of the problem? > The exact same code on the exact same version of Derby doesn't cause the same > problem over here; could it be something which only happens when unusual > network conditions are happening, or something which only happens when the > database meets a certain condition? > > Daniel > I have tried getting a blob from a result set and tried the length() method on it after the following Scenarios 1) Closing the connection 2) committing the transaction 3) Rolling back the transaction In the above three I got the expected SQLState. 4) Tried shutting down the network server just before blob.length I get the following Exception in thread "main" java.sql.SQLNonTransientConnectionException: Insufficient data while reading from the network - expected a minimum of 6 bytes and received only -1 bytes. The connection has been terminated. at org.apache.derby.client.am.SQLExceptionFactory40.getSQLException(SQLExceptionFactory40.java:70) at org.apache.derby.client.am.SqlException.getSQLException(SqlException.java:362) at org.apache.derby.client.am.Blob.length(Blob.java:141) at javaapplication2.Main.main(Main.java:31) None of the above scenarios seem to be giving the exception pointed out. Narayanan