Return-Path: X-Original-To: apmail-db-derby-user-archive@www.apache.org Delivered-To: apmail-db-derby-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 63345D42F for ; Mon, 3 Dec 2012 13:56:32 +0000 (UTC) Received: (qmail 44329 invoked by uid 500); 3 Dec 2012 13:56:32 -0000 Delivered-To: apmail-db-derby-user-archive@db.apache.org Received: (qmail 44036 invoked by uid 500); 3 Dec 2012 13:56:28 -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 44010 invoked by uid 99); 3 Dec 2012 13:56:27 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 03 Dec 2012 13:56:27 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of david.myers.scibearspace@gmail.com designates 209.85.217.172 as permitted sender) Received: from [209.85.217.172] (HELO mail-lb0-f172.google.com) (209.85.217.172) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 03 Dec 2012 13:56:19 +0000 Received: by mail-lb0-f172.google.com with SMTP id y2so2433454lbk.31 for ; Mon, 03 Dec 2012 05:55:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type; bh=ArXyHMyxJ1RXiycTnlimofnLKUj84klmcgELXw1BC5c=; b=me2L4aty9HxSxfp5ieKKW+ltTd2RREFYuvI6skP88FNUahD8Tj9APd+wpR4oRKsFVx gtbwr2yBnjvChtY5pnX5Ch55NKR5WjvqSOzkSGHihx+f9vjnkB1bBVhepBN9iXc2tJ+A eS9WW0825CRXNoee+4A7566/TndE0X5psMP+3srHiaoWk/Sh41+i1kGPFQLM7uDNEzIl mrC93N5/7vwCh9g9T9NYYzz+tHM5Ac98Oc43QLVyGQ+x37XfawHnxVE2A5GHTrXu/bGP jtgOE+QSVzMuHxAvzqW8unE4gZlQ25PJFnHOST/vJTrQyFevq6gLexrHyt+l+sFtYJBZ 01BA== Received: by 10.112.31.200 with SMTP id c8mr4300872lbi.61.1354542957865; Mon, 03 Dec 2012 05:55:57 -0800 (PST) Received: from [192.168.0.17] (85-170-89-255.rev.numericable.fr. [85.170.89.255]) by mx.google.com with ESMTPS id hu6sm5332904lab.13.2012.12.03.05.55.55 (version=SSLv3 cipher=OTHER); Mon, 03 Dec 2012 05:55:56 -0800 (PST) Message-ID: <50BCAF6A.9010608@gmail.com> Date: Mon, 03 Dec 2012 14:55:54 +0100 From: david myers User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: derby-user@db.apache.org Subject: Re: NullPointerException in Derby 10.9.1.0 References: <50B66527.5040906@gmail.com> In-Reply-To: Content-Type: multipart/alternative; boundary="------------090709040902030003040607" X-Virus-Checked: Checked by ClamAV on apache.org This is a multi-part message in MIME format. --------------090709040902030003040607 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit On 03/12/12 14:12, Knut Anders Hatlen wrote: > Zorro writes: > >> Dear All, >> >> When doing in ij a bulk Insert into a table of my Derby database I do >> get a NullPointerException. > Hi Harm-Jan, > > It looks like you've come across a bug. I managed to reproduce the > NullPointerException in my environment, so I filed a bug report and > posted the steps I followed in order to reproduce it there: > https://issues.apache.org/jira/browse/DERBY-6006 > > Thanks for reporting the problem, > Hi Harm-Jan and Knut, first off a bit of a long post, but I hope it may be informative... I've just seen Knut's jira bug ([jira] (DERBY-6006)), and wonder (having looked at the stack trace that was posted) if the 'conglomerate' error at the top of the stack is related to a problem I experienced. My problem can be recreated as follows.... > Create a table in your db (any structure will do) > programatically take one of your fields and change its data type (from int to float for example). When you do this programatically the only way to do it is to... > create a new 'temp' field > copy the values from the original into the new > drop the original table > rename the 'temp' field so as you can use your table in your previously created routines etc... > the problem this creates is that the new 'temp' field, although for all intents is the 'same' as the original has a different value in the conglomerates tables. Result: If you have use an external process that inserts data into the table from a select * the order of the fields has changed, and so the insert fails as the original fields have been 'shifted' to the left. EG: Original table field order. field1:field2:changeTypeOfThisfield:field3:field4:field5 new field after the modification. field1:field2:field3:field4:field5:changedTypeOfThisField Solution: Programatically capture the names of the fields to ensure they stay in a 'predefined' order. The problem seen by Harm-Jan may have an similar solution, the problem being of course that it is now neccessary to programatically do the insert select (rather then being able to do it directly in ij), which seems a bit brutal. So the reflection for Knut is: Is it possible to that internally the engine is creating a temp / shadow table and making a mess of these conglomerates during that process, and doing something like I have encountered (and how to test if the conglomerates are changing in this way) If so my problem, which I have been considering calling a 'documentation bug' on, may be less benign and require a more involved solution. Of course I may be off the mark, it was seeing the 'conglomerates error' that made me connect the 2 in my mind. David. --------------090709040902030003040607 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit
On 03/12/12 14:12, Knut Anders Hatlen wrote:
Zorro <hz0885@gmail.com> writes:

Dear All,

When doing in ij a bulk Insert into a table of my Derby database I do
get a NullPointerException.
Hi Harm-Jan,

It looks like you've come across a bug. I managed to reproduce the
NullPointerException in my environment, so I filed a bug report and
posted the steps I followed in order to reproduce it there:
https://issues.apache.org/jira/browse/DERBY-6006

Thanks for reporting the problem,

Hi Harm-Jan and Knut,

first off a bit of a long post, but I hope it may be informative...

I've just seen Knut's jira bug ([jira] (DERBY-6006)), and wonder (having looked at the stack trace that was posted) if the 'conglomerate' error at the top of the stack is related to a problem I experienced.

My problem can be recreated as follows....

> Create a table in your db (any structure will do)
> programatically take one of your fields and change its data type (from int to float for example).
When you do this programatically the only way to do it is to...
> create a new 'temp' field
> copy the values from the original into the new
> drop the original table
> rename the 'temp' field so as you can use your table in your previously created routines etc...
> the problem this creates is that the new 'temp' field, although for all intents is the 'same' as the original has a different value in the conglomerates tables.

Result:
    If you have use an external process that inserts data into the table from a select * the order of the fields has changed, and so the insert fails as the original fields have been 'shifted' to the left.

EG: Original table field order.
field1:field2:changeTypeOfThisfield:field3:field4:field5

new field after the modification.

field1:field2:field3:field4:field5:changedTypeOfThisField

Solution:

Programatically capture the names of the fields to ensure they stay in a 'predefined' order.

The problem seen by Harm-Jan may have an similar solution, the problem being of course that it is now neccessary to programatically do the insert select (rather then being able to do it directly in ij), which seems a bit brutal.

So the reflection for Knut is: Is it possible to that internally the engine is creating a temp / shadow table and making a mess of these conglomerates during that process, and doing something like I have encountered (and how to test if the conglomerates are changing in this way)

If so my problem, which I have been considering calling a 'documentation bug' on, may be less benign and require a more involved solution.

Of course I may be off the mark, it was seeing the 'conglomerates error' that made me connect the 2 in my mind.

David.


--------------090709040902030003040607--