db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kristian Waagan <Kristian.Waa...@Sun.COM>
Subject Re: Confusing error message on boot?
Date Thu, 19 Nov 2009 11:11:58 GMT
Myrna van Lunteren wrote:
> On Tue, Nov 17, 2009 at 9:35 AM, Knut Anders Hatlen <Knut.Hatlen@sun.com> wrote:
>> Kristian Waagan <Kristian.Waagan@Sun.COM> writes:
>>> Hi,
>>> Working on the drop database feature (DERBY-4428), I noticed this:
>>> ij> connect 'jdbc:derby:memory:test;shutdown=true;drop=true';
>>> ERROR XJ048: Conflicting boot attributes specified: shutdown, drop
>>> ij> connect 'jdbc:derby:memory:test;shutdown=true;create=true';
>>> ERROR XJ004: Database 'memory:test' not found.
>>> The error XJ0048 is new (I'm considering adding it).
>>> However, note that if you specify both shutdown and create you're told
>>> that the database doesn't exist. What happens is that the shutdown
>>> attribute takes precedence over the create attribute.
>>> Should we change this to show something like XJ048?
>> That sounds like a more reasonable response, at least.
>>> Can we change it without causing trouble for existing applications?
>> The potential incompatibility here, if I understand correctly, is that
>> if the database 'test' is booted when that command is issued, the
>> command currently shuts down the database, whereas with the suggested
>> change it reports that the attributes are in conflict and leaves the
>> database booted?
>> The combination of shutdown=true and create=true doesn't make much sense
>> (unless it meant create a database and shut it down cleanly, which it
>> doesn't). So if we haven't documented anywhere that shutdown takes
>> precedence over create, I wouldn't think it's very problematic to
>> disallow the combination.
>> --
>> Knut Anders
> I wrangled with this a bit when I was working on the
> jdbcapi.*DSCreateShutdownDBTest.java tests. It appeared at the time it
> was a given that if you use opposing details, you may get unexpected
> results. I may have made a change in the docs to state that - I can't
> remember.
> I like the idea of XJ048 message better...+1
> I don't think it likely, but it's still possible this may cause
> trouble for existing applications, someone might be checking for
> SQLState XJ004... (like in the test)? So not something suitable for a
> backport.
> From looking at that test, I also think there may be an issue with
> network server vs. embedded; network server apparently issues a 08004
> error...

Thanks for the feedback, everyone.

Since it seems changing this will require some more work, I don't plan 
to do it right now. I do plan to introduce XJ048 as part of DERBY-4428, 
then we can reuse it later.

Note that we are using different states for different types of 
conflicting attributes, for instance create, restore and replication. 
These are more specific, but less verbose.


> Myrna

View raw message