db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mike Matrigali <mikem_...@sbcglobal.net>
Subject Re: What error action is taken when "ENVIRONMENTAL" errors are raised
Date Fri, 30 Mar 2007 22:01:30 GMT


Army wrote:
> Mike Matrigali wrote:
> 
>>
>> I was left with a set of exceptions with no explicit mapping, so my 
>> reading is that they default to ENVIRONMENTAL severity, but it is not
>> clear to me what action is taken if we raised this level.  For what I
>> am trying to tell do we back out the statement or not?
> 
> 
> Are you asking if we *should* back out the statement, are you asking if 
> we *do* back out the statement?
> 
>> "XML" errors - not sure what severity action is taken:
>>     String LANG_MISSING_XML_CLASSES                = "XML00";
>>     String LANG_UNEXPECTED_XML_EXCEPTION           = "XML01";
> 
> 
> If either of these errors occurs I would expect that the statement in 
> question _should_ effectively be "backed out".  So I guess this means 
> that they should have "statement" severity?
> 
> Note that XML00 should theoretically occur before any changes to the 
> database occur, so I would expect that backing the statement out would 
> be no-op for that kind of error.  XML01 is by nature "unexpected" so it 
> could occur at pretty much any point during XML processing, and thus may 
> require "back out".  If that's not done automatically then I don't know 
> how to make it happen; would marking it as "statement severity" (by 
> adding ".S" to it) be sufficient?
I think adding .S would be sufficient.  Then when the system raises that 
exception the standard exception handling stack will do statement level
error handling.  To me all seem like statement level errors - it should
be sufficient to set the proper severity and then let the system handle
it.
> 
>>    String LANG_XML_QUERY_ERROR                     = "10000";
> 
> 
> This is similar to LANG_UNEXPECED_XML_EXCEPTION, except that the 
> unexpected error occured while evaluating an XQuery (or in the case of 
> Derby, XPath) expression.  SQL/XML 2003 spec says that such an error 
> should have SQLSTATE 10000.  So I think this should have an explicit 
> "statement" severity, as well.
> 
> I admit I don't really know much about severity actions, so I don't know 
> if I've answered your question or not...apologies for my ignorance here.

Given your answers I think it would be safest to set the severity action 
to statement explicitly.  I still don't understand the "default" action,
so it may be doing the right thing, I just don't know.  I believe 
setting the severity explicity to 10000.S will still return an SQLSTATE 
of 10000.  Is there an existing test that verifies the return value is
10000 (using standard jdbc to get the actual return value)?
> 
> Army
> 
> 
> 
> 
> 


Mime
View raw message