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 DF0C7FB8C for ; Tue, 1 Oct 2013 16:56:48 +0000 (UTC) Received: (qmail 45415 invoked by uid 500); 1 Oct 2013 16:56:45 -0000 Delivered-To: apmail-db-derby-user-archive@db.apache.org Received: (qmail 44387 invoked by uid 500); 1 Oct 2013 16:56:41 -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 44374 invoked by uid 99); 1 Oct 2013 16:56:40 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 01 Oct 2013 16:56:40 +0000 X-ASF-Spam-Status: No, hits=-2.3 required=5.0 tests=RCVD_IN_DNSWL_MED,SPF_PASS,UNPARSEABLE_RELAY X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of rick.hillegas@oracle.com designates 141.146.126.69 as permitted sender) Received: from [141.146.126.69] (HELO aserp1040.oracle.com) (141.146.126.69) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 01 Oct 2013 16:56:32 +0000 Received: from ucsinet21.oracle.com (ucsinet21.oracle.com [156.151.31.93]) by aserp1040.oracle.com (Sentrion-MTA-4.3.1/Sentrion-MTA-4.3.1) with ESMTP id r91Gu9bF001188 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 1 Oct 2013 16:56:10 GMT Received: from userz7022.oracle.com (userz7022.oracle.com [156.151.31.86]) by ucsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id r91Gu9vM012549 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Tue, 1 Oct 2013 16:56:09 GMT Received: from abhmt114.oracle.com (abhmt114.oracle.com [141.146.116.66]) by userz7022.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id r91Gu8gh013378 for ; Tue, 1 Oct 2013 16:56:09 GMT Received: from dhcp-amer-vpn-rmdc-anyconnect-10-159-92-234.vpn.oracle.com (/10.159.92.234) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 01 Oct 2013 09:56:08 -0700 Message-ID: <524AFEAF.6060105@oracle.com> Date: Tue, 01 Oct 2013 09:56:15 -0700 From: Rick Hillegas User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.7; en-US; rv:1.9.2.18) Gecko/20110616 Thunderbird/3.1.11 MIME-Version: 1.0 To: derby-user@db.apache.org Subject: Re: Serious issue with 10.10.1.1 and tomcat-jdbc References: <348193E9-7912-4706-9925-31EF7706C6DD@HoudiniESQ.com> <38EE3654-A4BD-4A37-87D4-B739C973F916@HoudiniESQ.com> In-Reply-To: <38EE3654-A4BD-4A37-87D4-B739C973F916@HoudiniESQ.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Source-IP: ucsinet21.oracle.com [156.151.31.93] X-Virus-Checked: Checked by ClamAV on apache.org On 10/1/13 9:02 AM, Frank Rivera wrote: > ALTER TABLE esq.licreq ADD COLUMN u_domain GENERATED ALWAYS AS > (UPPER(domain)) Hi Frank, I have been able to reproduce this problem when the connected user (ROOT in this case) has not created any schema objects of his own. I have logged https://issues.apache.org/jira/browse/DERBY-6361 to track this problem. Derby only implicitly creates a schema for the default APP user. Derby is supposed to implicitly create a schema for the connected user when the user performs certain operations. But this ALTER TABLE statement isn't one of those operations. The workaround would be to make sure that a schema has been created for the connected user. This can be done explicitly like this... CREATE SCHEMA root; Here's a script which shows the problem: connect 'jdbc:derby:memory:db;create=true;user=esq'; create table licreq( domain varchar( 10 ) ); connect 'jdbc:derby:memory:db;user=root'; -- fails ALTER TABLE esq.licreq ADD COLUMN u_domain GENERATED ALWAYS AS (UPPER(domain)); create schema root; -- succeeds ALTER TABLE esq.licreq ADD COLUMN u_domain GENERATED ALWAYS AS (UPPER(domain)); Hope this helps, -Rick