You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-dev@db.apache.org by Kristian Waagan <Kr...@Sun.COM> on 2009/11/17 16:31:20 UTC

Confusing error message on boot?

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?
Can we change it without causing trouble for existing applications?


-- 
Kristian

Re: Confusing error message on boot?

Posted by Rick Hillegas <Ri...@Sun.COM>.
Kristian Waagan wrote:
> 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?
> Can we change it without causing trouble for existing applications?
>
>
Hi Kristian,

I suppose that shutdown+create might arise when using DataSources or 
when using DriverManager.getConnection(String url, Properties info). 
Such applications might need to be changed to account for the new error 
message. I don't think we guarantee the stability of this part of our 
api--SQLStates in Derby do change from release to release. That may be 
wrong of us, but that's how we've been operating for a long time.

I think that the risk is low and the cleanup you are proposing is useful.

My $0.02,
-Rick

Re: Confusing error message on boot?

Posted by Kristian Waagan <Kr...@Sun.COM>.
Myrna van Lunteren wrote:
> On Tue, Nov 17, 2009 at 9:35 AM, Knut Anders Hatlen <Kn...@sun.com> wrote:
>   
>> Kristian Waagan <Kr...@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.


-- 
Kristian

> Myrna
>   


Re: Confusing error message on boot?

Posted by Myrna van Lunteren <m....@gmail.com>.
On Tue, Nov 17, 2009 at 9:35 AM, Knut Anders Hatlen <Kn...@sun.com> wrote:
> Kristian Waagan <Kr...@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...

Myrna

Re: Confusing error message on boot?

Posted by Knut Anders Hatlen <Kn...@Sun.COM>.
Kristian Waagan <Kr...@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