From derby-user-return-12016-apmail-db-derby-user-archive=db.apache.org@db.apache.org Thu Dec 31 23:21:41 2009 Return-Path: Delivered-To: apmail-db-derby-user-archive@www.apache.org Received: (qmail 70258 invoked from network); 31 Dec 2009 23:21:41 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 31 Dec 2009 23:21:41 -0000 Received: (qmail 19535 invoked by uid 500); 31 Dec 2009 23:21:40 -0000 Delivered-To: apmail-db-derby-user-archive@db.apache.org Received: (qmail 19460 invoked by uid 500); 31 Dec 2009 23:21:40 -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 19452 invoked by uid 99); 31 Dec 2009 23:21:40 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 31 Dec 2009 23:21:40 +0000 X-ASF-Spam-Status: No, hits=-3.4 required=5.0 tests=BAYES_00,FH_DATE_PAST_20XX,RCVD_IN_DNSWL_MED X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [192.18.6.24] (HELO gmp-eb-inf-2.sun.com) (192.18.6.24) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 31 Dec 2009 23:21:31 +0000 Received: from fe-emea-10.sun.com (gmp-eb-lb-1-fe1.eu.sun.com [192.18.6.7] (may be forged)) by gmp-eb-inf-2.sun.com (8.13.7+Sun/8.12.9) with ESMTP id nBVNL9it024736 for ; Thu, 31 Dec 2009 23:21:09 GMT MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; CHARSET=US-ASCII Received: from conversion-daemon.fe-emea-10.sun.com by fe-emea-10.sun.com (Sun Java(tm) System Messaging Server 7u2-7.04 64bit (built Jul 2 2009)) id <0KVJ00400HTHV400@fe-emea-10.sun.com> for derby-user@db.apache.org; Thu, 31 Dec 2009 23:20:44 +0000 (GMT) Received: from localhost ([unknown] [89.11.158.128]) by fe-emea-10.sun.com (Sun Java(tm) System Messaging Server 7u2-7.04 64bit (built Jul 2 2009)) with ESMTPSA id <0KVJ00ANTI6J4J70@fe-emea-10.sun.com> for derby-user@db.apache.org; Thu, 31 Dec 2009 23:20:44 +0000 (GMT) Date: Fri, 01 Jan 2010 00:20:48 +0100 From: Knut Anders Hatlen Subject: Re: CLASSPATH scripts do not work as defined in Getting Started in Derby Guide In-reply-to: <1262300582.3083.33.camel@aragorn> Sender: Knut.Hatlen@Sun.COM To: Derby Discussion Message-id: References: <1262300582.3083.33.camel@aragorn> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (usg-unix-v) "John Storta Jr." writes: > I have just started working with Derby. I was going through the getting > started guide and came across an issue. > > On pages 13 and 14 of the 'Getting Started in Derby Guide', there are 3 > scripts referenced that can be used to set the CLASSPATH environment > variable. setEmbeddedCP, setNetworkServerCP, & setNetworkClientCP. The > documentation indicates that the appropriate script should be run > depending on your needs. > > Running the scripts like any other script does not work. > > When a script is run, it launches a new shell for that script. The > CLASSPATH is set within that shell. Once the script is complete, that > shell exits and you are returned to your shell. The CLASSPATH is only > changed for the shell that the script was running in. The CLASSPATH in > your shell is unchanged. > > $ ${DERBY_HOME}/bin/setNetworkClientCP > Will result in your CLASSPATH being unchanged. > > In order for CLASSPATH in your shell to be updated, you have to run the > script from within your shell (not launch a new shell). This is done by > 'sourcing' the script. > > $ . ${DERBY_HOME}/bin/setNetworkClientCP > Will run the script within your shell resulting in your CLASSPATH being > updated. > > The documentation is not clear on this. > > Updating the documentation to state that the scripts should be sourced > rather than run will introduce another problem. The scripts contain > error checks which will exit the shell if DERBY_HOME is not set. If you > source the script, it is running in your shell, which means your shell > will exit if the error is encountered. > > The documentation should be updated and the scripts would need to be > updated to spit out the error, but not exit the shell. > > I looked through JIRA and I do not see this logged as a bug. If there > is agreement that this is a bug, I can open one. As I am new to this, I > wanted to bounce it off the list first. Hi John, It sounds like a bug to me. Please go ahead and log it. It's probably best if you log two separate issues; one for updating the documentation and one for updating the scripts. Note that DERBY-4283 (setEmbeddedCP should not exit on error) was recently logged and fixed, but only the setEmbeddedCP script was touched, so the problem still persists in setNetworkClientCP and setNetworkServerCP. Thanks, -- Knut Anders