You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by ar...@EASTPOINT.COM on 2003/01/30 00:52:55 UTC

SQL Extension Warnings

I am continuing my work on the Xalan SQL extension enhancements (after a bit
of a hiatus). One of my developers brought it to my attention that SQL
warnings do not get logged anywhere and are not accessible. The SQL warnings
are things like SQL PRINT and RAISERROR output. For my purposes I just need
these to go to a log (via the ErrorListener).

I am wondering if there is any interest in a method to get the messages,
perhaps XConnection.getMessage() akin to XConnection.getError()?

This also brings up a couple of questions. If there is interest in access to
the messages, how should they be formatted? Also, and this applies to the
errors as well, Messages are chained (SQLWarning.getNextWarning() obtains
the next warning in the chain - similarly SQLException.getNextException()
gets the next exception). If we create a getWarning() method, should it
return all the warnings or just the first one in the chain. Also for
getError(), same question.

Again, my own concern at this point is just that the warnings make it to the
log. For this I am planning to just pass the warning to the ErrorListener
(SQLWarning extends SQLException). Eventually then my error handler will
determine if it wants to do anything with the SQLWarning and/or if the chain
should be handled.

My personal feeling is that since I have not heard anyone make any mention
of handling warnings (or errors/Exceptions for that matter) with the Xalan
SQL Extension that it would not be important that they be accessible to the
stylesheet.

Thank You,
Art

Re: SQL Extension Warnings

Posted by John Gentilin <ge...@eyecatching.com>.
Art,

I think if we expand on the notion of the document returned in the
getError() (with possibly changing the
method name) we could allow the SS designer to  handle all
errors/warnings using the document and simple
XPath statements. I don't think the current mechanism handle the full
Error stack i.e. getNextException(), the
document should reflect the whole SQL error/message stack. This
mechanism coupled with the ErrorListener
should provide a very flexible system.

Regards
John G

art_w@EASTPOINT.COM wrote:

>
>
> I am continuing my work on the Xalan SQL extension enhancements (after
> a bit of a hiatus). One of my developers brought it to my attention
> that SQL warnings do not get logged anywhere and are not accessible.
> The SQL warnings are things like SQL PRINT and RAISERROR output. For
> my purposes I just need these to go to a log (via the ErrorListener).
>
> I am wondering if there is any interest in a method to get the
> messages, perhaps XConnection.getMessage() akin to
> XConnection.getError()?
>
> This also brings up a couple of questions. If there is interest in
> access to the messages, how should they be formatted? Also, and this
> applies to the errors as well, Messages are chained
> (SQLWarning.getNextWarning() obtains the next warning in the chain -
> similarly SQLException.getNextException() gets the next exception). If
> we create a getWarning() method, should it return all the warnings or
> just the first one in the chain. Also for getError(), same question.
>
> Again, my own concern at this point is just that the warnings make it
> to the log. For this I am planning to just pass the warning to the
> ErrorListener (SQLWarning extends SQLException). Eventually then my
> error handler will determine if it wants to do anything with the
> SQLWarning and/or if the chain should be handled.
>
> My personal feeling is that since I have not heard anyone make any
> mention of handling warnings (or errors/Exceptions for that matter)
> with the Xalan SQL Extension that it would not be important that they
> be accessible to the stylesheet.
>
> Thank You,
> Art

--
--------------------------------------
John Gentilin
Eye Catching Solutions Inc.
18314 Carlwyn Drive
Castro Valley CA 94546

    Contact Info
gentijo@eyecatching.com
Ca Office 1-510-881-4821
NJ Office 1-732-422-4917