db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas Dudziak <tom...@gmail.com>
Subject Re: Why are classpath databases always read-only ?
Date Thu, 08 Dec 2005 18:41:55 GMT
On 12/8/05, Daniel John Debrunner <djd@debrunners.com> wrote:
> > 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).
>
> If the 'you' means me, then I don't have the time or the itch to add it.
> I'm willing to provide guidance on how to do it.
>
> If the 'you' means the Derby community, then if someone provided this
> functionality I can't see it being rejected.

With you I meant the Derby developers.

> > 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.
>
> Maybe you could explain how this would work? Are you assuming that the
> war/ear file is always unpacked into the local file system? Is that
> guaranteed for a J2EE server?

No I cannot assume that, but if (and my guess it should be possible to
determine where a resource loaded from the classpath came from, e.g.
whether the URL contains a jar: protocol) then this would work. And if
not, it can obviously not be written. But for servlet containers like
Tomcat and Jetty, one can ensure that the web app is unpackaged before
it is started.
Not to mention that this would be useful for normal (non-web)
applications as well.

Tom

Mime
View raw message