Return-Path: Delivered-To: apmail-db-derby-user-archive@www.apache.org Received: (qmail 51689 invoked from network); 8 Dec 2005 16:27:11 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 8 Dec 2005 16:27:11 -0000 Received: (qmail 65118 invoked by uid 500); 8 Dec 2005 16:27:10 -0000 Delivered-To: apmail-db-derby-user-archive@db.apache.org Received: (qmail 65088 invoked by uid 500); 8 Dec 2005 16:27:09 -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 65077 invoked by uid 99); 8 Dec 2005 16:27:09 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 08 Dec 2005 08:27:09 -0800 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of tomdzk@gmail.com designates 64.233.182.194 as permitted sender) Received: from [64.233.182.194] (HELO nproxy.gmail.com) (64.233.182.194) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 08 Dec 2005 08:27:08 -0800 Received: by nproxy.gmail.com with SMTP id h2so211214nfe for ; Thu, 08 Dec 2005 08:26:47 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=PC+87IOXzI6EGzTJVcge0556L253X+MOKX1xaxl9wil0OKu4+/8s4AxhOKC1QabuPKJ4bvRD4X2IO0TdfxerqAvJmg129GRAkNyJEcKCu6pa4UyawjbfIKtoOpHh1ERruY+BqZcCz5FyXp+ADloN+kk96scRRGtXHGsBCN15KCM= Received: by 10.49.35.16 with SMTP id n16mr289124nfj; Thu, 08 Dec 2005 08:26:47 -0800 (PST) Received: by 10.48.250.6 with HTTP; Thu, 8 Dec 2005 08:26:47 -0800 (PST) Message-ID: <224f32340512080826v2ed2b780ie0904a0f9d0591e5@mail.gmail.com> Date: Thu, 8 Dec 2005 17:26:47 +0100 From: Thomas Dudziak To: Derby Discussion Subject: Re: Why are classpath databases always read-only ? In-Reply-To: <43984C40.3090507@debrunners.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <224f32340512080309s75d9cb83xf8fbd1ca9d8ee172@mail.gmail.com> <43984C40.3090507@debrunners.com> X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N On 12/8/05, Daniel John Debrunner wrote: > Thomas Dudziak wrote: > > > the manual says > > (http://db.apache.org/derby/docs/10.1/devguide/rdevdvlp38881.html): > > > > "classpath Databases are treated as read-only databases, and all > > databaseNames must begin with at least a slash, because you specify > > them "relative" to the classpath directory." > > > > Now I wonder why that is so ? Is there a particular reason to treat > > these always as read-only ? If the classpath points to a local > > directory (as opposed to, say, a jar), Derby could easily resolve this > > to a real path and work with this. > > Only because no-one has asked for this feature and maybe at the time I > didn't realise you could get to the real path from the resource. When > this feature was added Cloudscape was running on JDK 1.1 where the > getURL method was not available. Would you consider adding it ? I think that is would be really useful because it would decouple the app from where it runs (without having to run Derby in server mode). > > This would allow web applications to be created with an initial, > > embedded Derby database without having to hard-code the absolute > > database path (no assumption can be made as to where the current > > working directory is when running in a servlet container, so the path > > must be absolute). > > Also, you can package a read-only database in a jar file and archive > that in the web-application archive, war or ear file. Then one can > distribute read-only data with web-applications and access that data > without ever unpacking the war/ear file and not knowing its location on > disk. Sure, but that is exactly the point: the database is read-only. If I want to have an embedded database (e.g. co-located to the web app, say, in WEB-INF/classes/derbydb) then I have to use a jdbc directory url with an absoulte path which kind of defeats the concept of WARs. Or I have to determine the JDBC url at runtime as a workaround, but that IMHO is ugly. regards, Tom