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 "David W. Van Couvering" <Da...@Sun.COM> on 2006/01/25 02:10:12 UTC

Multiple causes for same SQL State

I have noticed that there can be multiple exceptions that can map to the 
same standard SQL State.  For example, 08003 means "connection does not 
exist".  I have found at least two places where this is valid.

I think it's reasonable to do something like this in SQLState.java

String CONN_ERROR_1 = "08003.C.1";
String CONN_ERROR_2 = "08003.C.2";

The code that extracts severity from the message id would not be 
impacted, as it only looks at the 7th character.

This seems reasonable to me, but looks like a break from what has been 
done in the past.  Is there anything I'm missing that I should be aware 
of before I take this approach?

Thanks,

David

Re: Multiple causes for same SQL State

Posted by Daniel John Debrunner <dj...@apache.org>.
David W. Van Couvering wrote:

> I have noticed that there can be multiple exceptions that can map to the
> same standard SQL State.  For example, 08003 means "connection does not
> exist".  I have found at least two places where this is valid.
> 
> I think it's reasonable to do something like this in SQLState.java
> 
> String CONN_ERROR_1 = "08003.C.1";
> String CONN_ERROR_2 = "08003.C.2";
> 
> The code that extracts severity from the message id would not be
> impacted, as it only looks at the 7th character.
> 
> This seems reasonable to me, but looks like a break from what has been
> done in the past.  Is there anything I'm missing that I should be aware
> of before I take this approach?

I think this approach is already taken for a few errors in the embedded
case.

Dan.