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 TomohitoNakayama <to...@basil.ocn.ne.jp> on 2005/10/08 08:06:17 UTC

Question about error messages (Re: Discussions on Wiki ...)

Hello.

This is question around next .
http://wiki.apache.org/db-derby/JDBC_error_messages_and_SQL_States

And it seems have something a lot to do with DERBY-254 .
http://issues.apache.org/jira/browse/DERBY-254

As in DERBY-254, there seems to be concept of "error of embedded" and "error of network" .
However, it is not clear what does distinguish one from another .
 * Whether user uses network or embedded driver distinguishes ? 
 * Whether exception happens in network or embedded implementation distinguishes ? 

Best regards .

/*

         Tomohito Nakayama
         tomonaka@basil.ocn.ne.jp
         tomohito@rose.zero.ad.jp
         tmnk@apache.org

         Naka
         http://www5.ocn.ne.jp/~tomohito/TopPage.html

*/
----- Original Message ----- 
From: "David W. Van Couvering" <Da...@Sun.COM>
To: "Derby Development" <de...@db.apache.org>
Sent: Saturday, October 08, 2005 5:44 AM
Subject: Re: Discussions on Wiki - WAS Re: SQL functions, procedures and PSM - a possible approach


> Hi, Tomohito.  It would be great if you could summarize your concerns in 
> email and we can continue our discussion on the list.
> 
> If it would help, I'm also more than open for you and I to have an IRC 
> conversation, log it, and send the log out to the list.  We do seem to 
> be a bit stuck :)
> 
> David
> 
> TomohitoNakayama wrote:
>> Hello.
>> 
>> I understand. Sorry for disturbing .
>> I had come to feel difficulties in discussing at Wiki.
>> 
>> Should I ask David my question in mailing list once more ?
>> 
>> Best regards.
>> 
>> /*
>> 
>>         Tomohito Nakayama
>>         tomonaka@basil.ocn.ne.jp
>>         tomohito@rose.zero.ad.jp
>>         tmnk@apache.org
>> 
>>         Naka
>>         http://www5.ocn.ne.jp/~tomohito/TopPage.html
>> 
>> */
>> ----- Original Message ----- From: "David W. Van Couvering" 
>> <Da...@Sun.COM>
>> To: "Derby Development" <de...@db.apache.org>
>> Sent: Friday, October 07, 2005 12:40 PM
>> Subject: Re: Discussions on Wiki - WAS Re: SQL functions, procedures and 
>> PSM - a possible approach
>> 
>> 
>>> I'm getting a little concerned, it feels a little quiet over there in 
>>> the corner with Tomohito and I, and I was about to propose with 
>>> Tomohito that we move it back to the list.
>>>
>>> David
>>>
>>> Daniel John Debrunner wrote:
>>>
>>>> David W. Van Couvering wrote:
>>>>
>>>>
>>>>> This sounds great, Dan!  Is this a good candidate for putting up on the
>>>>> Wiki site as a proposal?
>>>>
>>>>
>>>>
>>>> Is anyone else concerned by the movement of discussion to the wiki for
>>>> the common code stuff? The Apache way is for discussions to occur on the
>>>> mailing lists. It seems to me that the wiki is a great way to summarize
>>>> such discussions, but not to hold them. A wiki page related to a
>>>> discussion can provide a very useful single overview, something that
>>>> does get lost in mailings as the discussion spreads out.
>>>>
>>>> Dan.
>>>>
>>>>
>>>
>> 
>> 
>> -------------------------------------------------------------------------------- 
>> 
>> 
>> 
>> No virus found in this incoming message.
>> Checked by AVG Anti-Virus.
>> Version: 7.0.344 / Virus Database: 267.11.13/123 - Release Date: 2005/10/06
>> 
>> 
>> 
>


--------------------------------------------------------------------------------


No virus found in this incoming message.
Checked by AVG Anti-Virus.
Version: 7.0.344 / Virus Database: 267.11.13/124 - Release Date: 2005/10/07



-- 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.344 / Virus Database: 267.11.13/124 - Release Date: 2005/10/07


Re: Question about error messages (Re: Discussions on Wiki ...)

Posted by TomohitoNakayama <to...@basil.ocn.ne.jp>.
Hello.

>Hm, I'm not sure what article you're referring to
I mean article as your writing in DERBY-254
http://issues.apache.org/jira/browse/DERBY-254

I came to confused.

I thought you know what is client exception and what is embedded exception and ,
did not have implement to distinguish them in the program yet and ,
tried to make the implementation to distinguish them in DERBY-254 .

//Or do I musunderstood something at all ....?
//Is it not what you wanted to do ,to distingish client exception from embedded exception ?

Best regards.

/*

         Tomohito Nakayama
         tomonaka@basil.ocn.ne.jp
         tomohito@rose.zero.ad.jp
         tmnk@apache.org

         Naka
         http://www5.ocn.ne.jp/~tomohito/TopPage.html

*/
----- Original Message ----- 
From: "David W. Van Couvering" <Da...@Sun.COM>
To: "Derby Development" <de...@db.apache.org>
Sent: Wednesday, October 12, 2005 7:38 AM
Subject: Re: Question about error messages (Re: Discussions on Wiki ...)


> Hm, I'm not sure what article you're referring to, but I think there are 
> two important ways we want to make a distinction.  First of all, when 
> running in client/server mode, there are a class of exceptions that the 
> network client gets from the server and a class of exceptions that it 
> throws by itself.  How these are handled and thrown in the network 
> client are slightly different.  But so far that discussion doesn't seem 
> to have come up much.
> 
> Then, from the viewpoint of code sharing, there are two JDBC drivers, 
> embedded and network client.  Each of them have their own exceptions 
> they throw. *some* of these exceptions (actually, a large class of them) 
> are exactly the same error (e.g. "invalid max value passed as a 
> paramter" and "this routine is not implemented." )  The exceptions that 
> are common between client driver and embedded driver should have the 
> same SQL State and severity.  I also plan on sharing the messages so 
> that the translations can also be shared, saving us some significant 
> duplication of effort.
> 
> I have a feeling I'm still missing it, but we're getting there.
> 
> Are you still on for 4:30 today for a Skype chat?
> 
> David
> 
> TomohitoNakayama wrote:
>> Hello.
>> 
>>> If I understand you correctly, you are asking how the user
>>>
>>> (a) can tell if they're using the network driver or embedded driver and
>>>
>>> The DatabaseMetadata of a connection gives you the driver name, 
>>> product name, version, etc.  Would this give the information you're 
>>> looking for?
>>>
>>> (b) can tell if the exception came from the client or the server
>>>
>>> I don't think it's reasonable to want the SQLState to be different; I 
>>> think that many users very much want them to be the *same* across the 
>>> drivers, for the same error.  Kathey and Dan have made it pretty clear 
>>> they should be the same.
>> 
>> 
>> No no.
>> I ask you what "you" want to distinguish in this issue.
>> 
>> There seems to be concept of "error of embedded" and "error of network" 
>> in your article.
>> However, it is ambigous what is the difference between them.
>> 
>> At least , I couldn't read what they exactly are.
>> 
>> Best regards.
>> 
>> /*
>> 
>>         Tomohito Nakayama
>>         tomonaka@basil.ocn.ne.jp
>>         tomohito@rose.zero.ad.jp
>>         tmnk@apache.org
>> 
>>         Naka
>>         http://www5.ocn.ne.jp/~tomohito/TopPage.html
>> 
>> */
>> ----- Original Message ----- From: "David W. Van Couvering" 
>> <Da...@Sun.COM>
>> To: "Derby Development" <de...@db.apache.org>
>> Sent: Wednesday, October 12, 2005 2:52 AM
>> Subject: Re: Question about error messages (Re: Discussions on Wiki ...)
>> 
>> 
>>> If I understand you correctly, you are asking how the user
>>>
>>> (a) can tell if they're using the network driver or embedded driver and
>>>
>>> The DatabaseMetadata of a connection gives you the driver name, 
>>> product name, version, etc.  Would this give the information you're 
>>> looking for?
>>>
>>> (b) can tell if the exception came from the client or the server
>>>
>>> I don't think it's reasonable to want the SQLState to be different; I 
>>> think that many users very much want them to be the *same* across the 
>>> drivers, for the same error.  Kathey and Dan have made it pretty clear 
>>> they should be the same.
>>>
>>> And we have also agreed that using the error code or the implementing 
>>> class of SQLException is not valid because neither of these are public 
>>> (and therefore stable) interfaces.
>>>
>>> In the network client, when you construct a SQLException, the full 
>>> diagnostics of the exception are written to the configured log:
>>>
>>>           if (logWriter != null) {
>>>             logWriter.traceDiagnosable(this);
>>>
>>> if the exception is from the server, then the trace diagnostics 
>>> contain information that makes it clear the exception is from the server:
>>>
>>> if ( sqlca != null )
>>>             printWriter.println(header + " DERBY SQLCA from server");
>>>             printWriter.println(header + " SqlCode        = " + 
>>> sqlca.getSqlCode());
>>>             printWriter.println(header + " SqlErrd        = " + 
>>> Utils.getStringFromInts(sqlca.getSqlErrd()));
>>>             printWriter.println(header + " SqlErrmc       = " + 
>>> sqlca.getSqlErrmc());
>>>             printWriter.println(header + " SqlErrmcTokens = " + 
>>> Utils.getStringFromStrings(sqlca.getSqlErrmcTokens()));
>>>             printWriter.println(header + " SqlErrp        = " + 
>>> sqlca.getSqlErrp());
>>>             printWriter.println(header + " SqlState       = " + 
>>> sqlca.getSqlState());
>>>             printWriter.println(header + " SqlWarn        = " + new 
>>> String(sqlca.getSqlWarn()));
>>>
>>> It seems to me this should give the user the information they need, 
>>> right?
>>>
>>> Thanks,
>>>
>>> David
>>>
>>> TomohitoNakayama wrote:
>>>
>>>> Hello.
>>>>
>>>> This is question around next .
>>>> http://wiki.apache.org/db-derby/JDBC_error_messages_and_SQL_States
>>>>
>>>> And it seems have something a lot to do with DERBY-254 .
>>>> http://issues.apache.org/jira/browse/DERBY-254
>>>>
>>>> As in DERBY-254, there seems to be concept of "error of embedded" and 
>>>> "error of network" .
>>>> However, it is not clear what does distinguish one from another .
>>>> * Whether user uses network or embedded driver distinguishes ? * 
>>>> Whether exception happens in network or embedded implementation 
>>>> distinguishes ?
>>>> Best regards .
>>>>
>>>> /*
>>>>
>>>>         Tomohito Nakayama
>>>>         tomonaka@basil.ocn.ne.jp
>>>>         tomohito@rose.zero.ad.jp
>>>>         tmnk@apache.org
>>>>
>>>>         Naka
>>>>         http://www5.ocn.ne.jp/~tomohito/TopPage.html
>>>>
>>>> */
>>>> ----- Original Message ----- From: "David W. Van Couvering" 
>>>> <Da...@Sun.COM>
>>>> To: "Derby Development" <de...@db.apache.org>
>>>> Sent: Saturday, October 08, 2005 5:44 AM
>>>> Subject: Re: Discussions on Wiki - WAS Re: SQL functions, procedures 
>>>> and PSM - a possible approach
>>>>
>>>>
>>>>> Hi, Tomohito.  It would be great if you could summarize your 
>>>>> concerns in email and we can continue our discussion on the list.
>>>>>
>>>>> If it would help, I'm also more than open for you and I to have an 
>>>>> IRC conversation, log it, and send the log out to the list.  We do 
>>>>> seem to be a bit stuck :)
>>>>>
>>>>> David
>>>>>
>>>>> TomohitoNakayama wrote:
>>>>>
>>>>>> Hello.
>>>>>>
>>>>>> I understand. Sorry for disturbing .
>>>>>> I had come to feel difficulties in discussing at Wiki.
>>>>>>
>>>>>> Should I ask David my question in mailing list once more ?
>>>>>>
>>>>>> Best regards.
>>>>>>
>>>>>> /*
>>>>>>
>>>>>>         Tomohito Nakayama
>>>>>>         tomonaka@basil.ocn.ne.jp
>>>>>>         tomohito@rose.zero.ad.jp
>>>>>>         tmnk@apache.org
>>>>>>
>>>>>>         Naka
>>>>>>         http://www5.ocn.ne.jp/~tomohito/TopPage.html
>>>>>>
>>>>>> */
>>>>>> ----- Original Message ----- From: "David W. Van Couvering" 
>>>>>> <Da...@Sun.COM>
>>>>>> To: "Derby Development" <de...@db.apache.org>
>>>>>> Sent: Friday, October 07, 2005 12:40 PM
>>>>>> Subject: Re: Discussions on Wiki - WAS Re: SQL functions, 
>>>>>> procedures and PSM - a possible approach
>>>>>>
>>>>>>
>>>>>>> I'm getting a little concerned, it feels a little quiet over there 
>>>>>>> in the corner with Tomohito and I, and I was about to propose with 
>>>>>>> Tomohito that we move it back to the list.
>>>>>>>
>>>>>>> David
>>>>>>>
>>>>>>> Daniel John Debrunner wrote:
>>>>>>>
>>>>>>>> David W. Van Couvering wrote:
>>>>>>>>
>>>>>>>>
>>>>>>>>> This sounds great, Dan!  Is this a good candidate for putting up 
>>>>>>>>> on the
>>>>>>>>> Wiki site as a proposal?
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> Is anyone else concerned by the movement of discussion to the 
>>>>>>>> wiki for
>>>>>>>> the common code stuff? The Apache way is for discussions to occur 
>>>>>>>> on the
>>>>>>>> mailing lists. It seems to me that the wiki is a great way to 
>>>>>>>> summarize
>>>>>>>> such discussions, but not to hold them. A wiki page related to a
>>>>>>>> discussion can provide a very useful single overview, something that
>>>>>>>> does get lost in mailings as the discussion spreads out.
>>>>>>>>
>>>>>>>> Dan.
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>> -------------------------------------------------------------------------------- 
>>>>>>
>>>>>>
>>>>>>
>>>>>> No virus found in this incoming message.
>>>>>> Checked by AVG Anti-Virus.
>>>>>> Version: 7.0.344 / Virus Database: 267.11.13/123 - Release Date: 
>>>>>> 2005/10/06
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>
>>>>
>>>> -------------------------------------------------------------------------------- 
>>>>
>>>>
>>>>
>>>> No virus found in this incoming message.
>>>> Checked by AVG Anti-Virus.
>>>> Version: 7.0.344 / Virus Database: 267.11.13/124 - Release Date: 
>>>> 2005/10/07
>>>>
>>>>
>>>>
>>>
>

Re: Question about error messages (Re: Discussions on Wiki ...)

Posted by "David W. Van Couvering" <Da...@Sun.COM>.
Hm, I'm not sure what article you're referring to, but I think there are 
two important ways we want to make a distinction.  First of all, when 
running in client/server mode, there are a class of exceptions that the 
network client gets from the server and a class of exceptions that it 
throws by itself.  How these are handled and thrown in the network 
client are slightly different.  But so far that discussion doesn't seem 
to have come up much.

Then, from the viewpoint of code sharing, there are two JDBC drivers, 
embedded and network client.  Each of them have their own exceptions 
they throw. *some* of these exceptions (actually, a large class of them) 
are exactly the same error (e.g. "invalid max value passed as a 
paramter" and "this routine is not implemented." )  The exceptions that 
are common between client driver and embedded driver should have the 
same SQL State and severity.  I also plan on sharing the messages so 
that the translations can also be shared, saving us some significant 
duplication of effort.

I have a feeling I'm still missing it, but we're getting there.

Are you still on for 4:30 today for a Skype chat?

David

TomohitoNakayama wrote:
> Hello.
> 
>> If I understand you correctly, you are asking how the user
>>
>> (a) can tell if they're using the network driver or embedded driver and
>>
>> The DatabaseMetadata of a connection gives you the driver name, 
>> product name, version, etc.  Would this give the information you're 
>> looking for?
>>
>> (b) can tell if the exception came from the client or the server
>>
>> I don't think it's reasonable to want the SQLState to be different; I 
>> think that many users very much want them to be the *same* across the 
>> drivers, for the same error.  Kathey and Dan have made it pretty clear 
>> they should be the same.
> 
> 
> No no.
> I ask you what "you" want to distinguish in this issue.
> 
> There seems to be concept of "error of embedded" and "error of network" 
> in your article.
> However, it is ambigous what is the difference between them.
> 
> At least , I couldn't read what they exactly are.
> 
> Best regards.
> 
> /*
> 
>         Tomohito Nakayama
>         tomonaka@basil.ocn.ne.jp
>         tomohito@rose.zero.ad.jp
>         tmnk@apache.org
> 
>         Naka
>         http://www5.ocn.ne.jp/~tomohito/TopPage.html
> 
> */
> ----- Original Message ----- From: "David W. Van Couvering" 
> <Da...@Sun.COM>
> To: "Derby Development" <de...@db.apache.org>
> Sent: Wednesday, October 12, 2005 2:52 AM
> Subject: Re: Question about error messages (Re: Discussions on Wiki ...)
> 
> 
>> If I understand you correctly, you are asking how the user
>>
>> (a) can tell if they're using the network driver or embedded driver and
>>
>> The DatabaseMetadata of a connection gives you the driver name, 
>> product name, version, etc.  Would this give the information you're 
>> looking for?
>>
>> (b) can tell if the exception came from the client or the server
>>
>> I don't think it's reasonable to want the SQLState to be different; I 
>> think that many users very much want them to be the *same* across the 
>> drivers, for the same error.  Kathey and Dan have made it pretty clear 
>> they should be the same.
>>
>> And we have also agreed that using the error code or the implementing 
>> class of SQLException is not valid because neither of these are public 
>> (and therefore stable) interfaces.
>>
>> In the network client, when you construct a SQLException, the full 
>> diagnostics of the exception are written to the configured log:
>>
>>           if (logWriter != null) {
>>             logWriter.traceDiagnosable(this);
>>
>> if the exception is from the server, then the trace diagnostics 
>> contain information that makes it clear the exception is from the server:
>>
>> if ( sqlca != null )
>>             printWriter.println(header + " DERBY SQLCA from server");
>>             printWriter.println(header + " SqlCode        = " + 
>> sqlca.getSqlCode());
>>             printWriter.println(header + " SqlErrd        = " + 
>> Utils.getStringFromInts(sqlca.getSqlErrd()));
>>             printWriter.println(header + " SqlErrmc       = " + 
>> sqlca.getSqlErrmc());
>>             printWriter.println(header + " SqlErrmcTokens = " + 
>> Utils.getStringFromStrings(sqlca.getSqlErrmcTokens()));
>>             printWriter.println(header + " SqlErrp        = " + 
>> sqlca.getSqlErrp());
>>             printWriter.println(header + " SqlState       = " + 
>> sqlca.getSqlState());
>>             printWriter.println(header + " SqlWarn        = " + new 
>> String(sqlca.getSqlWarn()));
>>
>> It seems to me this should give the user the information they need, 
>> right?
>>
>> Thanks,
>>
>> David
>>
>> TomohitoNakayama wrote:
>>
>>> Hello.
>>>
>>> This is question around next .
>>> http://wiki.apache.org/db-derby/JDBC_error_messages_and_SQL_States
>>>
>>> And it seems have something a lot to do with DERBY-254 .
>>> http://issues.apache.org/jira/browse/DERBY-254
>>>
>>> As in DERBY-254, there seems to be concept of "error of embedded" and 
>>> "error of network" .
>>> However, it is not clear what does distinguish one from another .
>>> * Whether user uses network or embedded driver distinguishes ? * 
>>> Whether exception happens in network or embedded implementation 
>>> distinguishes ?
>>> Best regards .
>>>
>>> /*
>>>
>>>         Tomohito Nakayama
>>>         tomonaka@basil.ocn.ne.jp
>>>         tomohito@rose.zero.ad.jp
>>>         tmnk@apache.org
>>>
>>>         Naka
>>>         http://www5.ocn.ne.jp/~tomohito/TopPage.html
>>>
>>> */
>>> ----- Original Message ----- From: "David W. Van Couvering" 
>>> <Da...@Sun.COM>
>>> To: "Derby Development" <de...@db.apache.org>
>>> Sent: Saturday, October 08, 2005 5:44 AM
>>> Subject: Re: Discussions on Wiki - WAS Re: SQL functions, procedures 
>>> and PSM - a possible approach
>>>
>>>
>>>> Hi, Tomohito.  It would be great if you could summarize your 
>>>> concerns in email and we can continue our discussion on the list.
>>>>
>>>> If it would help, I'm also more than open for you and I to have an 
>>>> IRC conversation, log it, and send the log out to the list.  We do 
>>>> seem to be a bit stuck :)
>>>>
>>>> David
>>>>
>>>> TomohitoNakayama wrote:
>>>>
>>>>> Hello.
>>>>>
>>>>> I understand. Sorry for disturbing .
>>>>> I had come to feel difficulties in discussing at Wiki.
>>>>>
>>>>> Should I ask David my question in mailing list once more ?
>>>>>
>>>>> Best regards.
>>>>>
>>>>> /*
>>>>>
>>>>>         Tomohito Nakayama
>>>>>         tomonaka@basil.ocn.ne.jp
>>>>>         tomohito@rose.zero.ad.jp
>>>>>         tmnk@apache.org
>>>>>
>>>>>         Naka
>>>>>         http://www5.ocn.ne.jp/~tomohito/TopPage.html
>>>>>
>>>>> */
>>>>> ----- Original Message ----- From: "David W. Van Couvering" 
>>>>> <Da...@Sun.COM>
>>>>> To: "Derby Development" <de...@db.apache.org>
>>>>> Sent: Friday, October 07, 2005 12:40 PM
>>>>> Subject: Re: Discussions on Wiki - WAS Re: SQL functions, 
>>>>> procedures and PSM - a possible approach
>>>>>
>>>>>
>>>>>> I'm getting a little concerned, it feels a little quiet over there 
>>>>>> in the corner with Tomohito and I, and I was about to propose with 
>>>>>> Tomohito that we move it back to the list.
>>>>>>
>>>>>> David
>>>>>>
>>>>>> Daniel John Debrunner wrote:
>>>>>>
>>>>>>> David W. Van Couvering wrote:
>>>>>>>
>>>>>>>
>>>>>>>> This sounds great, Dan!  Is this a good candidate for putting up 
>>>>>>>> on the
>>>>>>>> Wiki site as a proposal?
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> Is anyone else concerned by the movement of discussion to the 
>>>>>>> wiki for
>>>>>>> the common code stuff? The Apache way is for discussions to occur 
>>>>>>> on the
>>>>>>> mailing lists. It seems to me that the wiki is a great way to 
>>>>>>> summarize
>>>>>>> such discussions, but not to hold them. A wiki page related to a
>>>>>>> discussion can provide a very useful single overview, something that
>>>>>>> does get lost in mailings as the discussion spreads out.
>>>>>>>
>>>>>>> Dan.
>>>>>>>
>>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>> -------------------------------------------------------------------------------- 
>>>>>
>>>>>
>>>>>
>>>>> No virus found in this incoming message.
>>>>> Checked by AVG Anti-Virus.
>>>>> Version: 7.0.344 / Virus Database: 267.11.13/123 - Release Date: 
>>>>> 2005/10/06
>>>>>
>>>>>
>>>>>
>>>>
>>>
>>>
>>> -------------------------------------------------------------------------------- 
>>>
>>>
>>>
>>> No virus found in this incoming message.
>>> Checked by AVG Anti-Virus.
>>> Version: 7.0.344 / Virus Database: 267.11.13/124 - Release Date: 
>>> 2005/10/07
>>>
>>>
>>>
>>

Re: Question about error messages (Re: Discussions on Wiki ...)

Posted by TomohitoNakayama <to...@basil.ocn.ne.jp>.
Hello.

> If I understand you correctly, you are asking how the user
> 
> (a) can tell if they're using the network driver or embedded driver and
> 
> The DatabaseMetadata of a connection gives you the driver name, product 
> name, version, etc.  Would this give the information you're looking for?
> 
> (b) can tell if the exception came from the client or the server
> 
> I don't think it's reasonable to want the SQLState to be different; I 
> think that many users very much want them to be the *same* across the 
> drivers, for the same error.  Kathey and Dan have made it pretty clear 
> they should be the same.

No no.
I ask you what "you" want to distinguish in this issue.

There seems to be concept of "error of embedded" and "error of network" in your article.
However, it is ambigous what is the difference between them.

At least , I couldn't read what they exactly are.

Best regards.

/*

         Tomohito Nakayama
         tomonaka@basil.ocn.ne.jp
         tomohito@rose.zero.ad.jp
         tmnk@apache.org

         Naka
         http://www5.ocn.ne.jp/~tomohito/TopPage.html

*/
----- Original Message ----- 
From: "David W. Van Couvering" <Da...@Sun.COM>
To: "Derby Development" <de...@db.apache.org>
Sent: Wednesday, October 12, 2005 2:52 AM
Subject: Re: Question about error messages (Re: Discussions on Wiki ...)


> If I understand you correctly, you are asking how the user
> 
> (a) can tell if they're using the network driver or embedded driver and
> 
> The DatabaseMetadata of a connection gives you the driver name, product 
> name, version, etc.  Would this give the information you're looking for?
> 
> (b) can tell if the exception came from the client or the server
> 
> I don't think it's reasonable to want the SQLState to be different; I 
> think that many users very much want them to be the *same* across the 
> drivers, for the same error.  Kathey and Dan have made it pretty clear 
> they should be the same.
> 
> And we have also agreed that using the error code or the implementing 
> class of SQLException is not valid because neither of these are public 
> (and therefore stable) interfaces.
> 
> In the network client, when you construct a SQLException, the full 
> diagnostics of the exception are written to the configured log:
> 
>           if (logWriter != null) {
>             logWriter.traceDiagnosable(this);
> 
> if the exception is from the server, then the trace diagnostics contain 
> information that makes it clear the exception is from the server:
> 
> if ( sqlca != null )
>             printWriter.println(header + " DERBY SQLCA from server");
>             printWriter.println(header + " SqlCode        = " + 
> sqlca.getSqlCode());
>             printWriter.println(header + " SqlErrd        = " + 
> Utils.getStringFromInts(sqlca.getSqlErrd()));
>             printWriter.println(header + " SqlErrmc       = " + 
> sqlca.getSqlErrmc());
>             printWriter.println(header + " SqlErrmcTokens = " + 
> Utils.getStringFromStrings(sqlca.getSqlErrmcTokens()));
>             printWriter.println(header + " SqlErrp        = " + 
> sqlca.getSqlErrp());
>             printWriter.println(header + " SqlState       = " + 
> sqlca.getSqlState());
>             printWriter.println(header + " SqlWarn        = " + new 
> String(sqlca.getSqlWarn()));
> 
> It seems to me this should give the user the information they need, right?
> 
> Thanks,
> 
> David
> 
> TomohitoNakayama wrote:
>> Hello.
>> 
>> This is question around next .
>> http://wiki.apache.org/db-derby/JDBC_error_messages_and_SQL_States
>> 
>> And it seems have something a lot to do with DERBY-254 .
>> http://issues.apache.org/jira/browse/DERBY-254
>> 
>> As in DERBY-254, there seems to be concept of "error of embedded" and 
>> "error of network" .
>> However, it is not clear what does distinguish one from another .
>> * Whether user uses network or embedded driver distinguishes ? * Whether 
>> exception happens in network or embedded implementation distinguishes ?
>> Best regards .
>> 
>> /*
>> 
>>         Tomohito Nakayama
>>         tomonaka@basil.ocn.ne.jp
>>         tomohito@rose.zero.ad.jp
>>         tmnk@apache.org
>> 
>>         Naka
>>         http://www5.ocn.ne.jp/~tomohito/TopPage.html
>> 
>> */
>> ----- Original Message ----- From: "David W. Van Couvering" 
>> <Da...@Sun.COM>
>> To: "Derby Development" <de...@db.apache.org>
>> Sent: Saturday, October 08, 2005 5:44 AM
>> Subject: Re: Discussions on Wiki - WAS Re: SQL functions, procedures and 
>> PSM - a possible approach
>> 
>> 
>>> Hi, Tomohito.  It would be great if you could summarize your concerns 
>>> in email and we can continue our discussion on the list.
>>>
>>> If it would help, I'm also more than open for you and I to have an IRC 
>>> conversation, log it, and send the log out to the list.  We do seem to 
>>> be a bit stuck :)
>>>
>>> David
>>>
>>> TomohitoNakayama wrote:
>>>
>>>> Hello.
>>>>
>>>> I understand. Sorry for disturbing .
>>>> I had come to feel difficulties in discussing at Wiki.
>>>>
>>>> Should I ask David my question in mailing list once more ?
>>>>
>>>> Best regards.
>>>>
>>>> /*
>>>>
>>>>         Tomohito Nakayama
>>>>         tomonaka@basil.ocn.ne.jp
>>>>         tomohito@rose.zero.ad.jp
>>>>         tmnk@apache.org
>>>>
>>>>         Naka
>>>>         http://www5.ocn.ne.jp/~tomohito/TopPage.html
>>>>
>>>> */
>>>> ----- Original Message ----- From: "David W. Van Couvering" 
>>>> <Da...@Sun.COM>
>>>> To: "Derby Development" <de...@db.apache.org>
>>>> Sent: Friday, October 07, 2005 12:40 PM
>>>> Subject: Re: Discussions on Wiki - WAS Re: SQL functions, procedures 
>>>> and PSM - a possible approach
>>>>
>>>>
>>>>> I'm getting a little concerned, it feels a little quiet over there 
>>>>> in the corner with Tomohito and I, and I was about to propose with 
>>>>> Tomohito that we move it back to the list.
>>>>>
>>>>> David
>>>>>
>>>>> Daniel John Debrunner wrote:
>>>>>
>>>>>> David W. Van Couvering wrote:
>>>>>>
>>>>>>
>>>>>>> This sounds great, Dan!  Is this a good candidate for putting up 
>>>>>>> on the
>>>>>>> Wiki site as a proposal?
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> Is anyone else concerned by the movement of discussion to the wiki for
>>>>>> the common code stuff? The Apache way is for discussions to occur 
>>>>>> on the
>>>>>> mailing lists. It seems to me that the wiki is a great way to 
>>>>>> summarize
>>>>>> such discussions, but not to hold them. A wiki page related to a
>>>>>> discussion can provide a very useful single overview, something that
>>>>>> does get lost in mailings as the discussion spreads out.
>>>>>>
>>>>>> Dan.
>>>>>>
>>>>>>
>>>>>
>>>>
>>>>
>>>> -------------------------------------------------------------------------------- 
>>>>
>>>>
>>>>
>>>> No virus found in this incoming message.
>>>> Checked by AVG Anti-Virus.
>>>> Version: 7.0.344 / Virus Database: 267.11.13/123 - Release Date: 
>>>> 2005/10/06
>>>>
>>>>
>>>>
>>>
>> 
>> 
>> -------------------------------------------------------------------------------- 
>> 
>> 
>> 
>> No virus found in this incoming message.
>> Checked by AVG Anti-Virus.
>> Version: 7.0.344 / Virus Database: 267.11.13/124 - Release Date: 2005/10/07
>> 
>> 
>> 
>

Re: Question about error messages (Re: Discussions on Wiki ...)

Posted by "David W. Van Couvering" <Da...@Sun.COM>.
If I understand you correctly, you are asking how the user

(a) can tell if they're using the network driver or embedded driver and

The DatabaseMetadata of a connection gives you the driver name, product 
name, version, etc.  Would this give the information you're looking for?

(b) can tell if the exception came from the client or the server

I don't think it's reasonable to want the SQLState to be different; I 
think that many users very much want them to be the *same* across the 
drivers, for the same error.  Kathey and Dan have made it pretty clear 
they should be the same.

And we have also agreed that using the error code or the implementing 
class of SQLException is not valid because neither of these are public 
(and therefore stable) interfaces.

In the network client, when you construct a SQLException, the full 
diagnostics of the exception are written to the configured log:

           if (logWriter != null) {
             logWriter.traceDiagnosable(this);

if the exception is from the server, then the trace diagnostics contain 
information that makes it clear the exception is from the server:

if ( sqlca != null )
             printWriter.println(header + " DERBY SQLCA from server");
             printWriter.println(header + " SqlCode        = " + 
sqlca.getSqlCode());
             printWriter.println(header + " SqlErrd        = " + 
Utils.getStringFromInts(sqlca.getSqlErrd()));
             printWriter.println(header + " SqlErrmc       = " + 
sqlca.getSqlErrmc());
             printWriter.println(header + " SqlErrmcTokens = " + 
Utils.getStringFromStrings(sqlca.getSqlErrmcTokens()));
             printWriter.println(header + " SqlErrp        = " + 
sqlca.getSqlErrp());
             printWriter.println(header + " SqlState       = " + 
sqlca.getSqlState());
             printWriter.println(header + " SqlWarn        = " + new 
String(sqlca.getSqlWarn()));

It seems to me this should give the user the information they need, right?

Thanks,

David

TomohitoNakayama wrote:
> Hello.
> 
> This is question around next .
> http://wiki.apache.org/db-derby/JDBC_error_messages_and_SQL_States
> 
> And it seems have something a lot to do with DERBY-254 .
> http://issues.apache.org/jira/browse/DERBY-254
> 
> As in DERBY-254, there seems to be concept of "error of embedded" and 
> "error of network" .
> However, it is not clear what does distinguish one from another .
> * Whether user uses network or embedded driver distinguishes ? * Whether 
> exception happens in network or embedded implementation distinguishes ?
> Best regards .
> 
> /*
> 
>         Tomohito Nakayama
>         tomonaka@basil.ocn.ne.jp
>         tomohito@rose.zero.ad.jp
>         tmnk@apache.org
> 
>         Naka
>         http://www5.ocn.ne.jp/~tomohito/TopPage.html
> 
> */
> ----- Original Message ----- From: "David W. Van Couvering" 
> <Da...@Sun.COM>
> To: "Derby Development" <de...@db.apache.org>
> Sent: Saturday, October 08, 2005 5:44 AM
> Subject: Re: Discussions on Wiki - WAS Re: SQL functions, procedures and 
> PSM - a possible approach
> 
> 
>> Hi, Tomohito.  It would be great if you could summarize your concerns 
>> in email and we can continue our discussion on the list.
>>
>> If it would help, I'm also more than open for you and I to have an IRC 
>> conversation, log it, and send the log out to the list.  We do seem to 
>> be a bit stuck :)
>>
>> David
>>
>> TomohitoNakayama wrote:
>>
>>> Hello.
>>>
>>> I understand. Sorry for disturbing .
>>> I had come to feel difficulties in discussing at Wiki.
>>>
>>> Should I ask David my question in mailing list once more ?
>>>
>>> Best regards.
>>>
>>> /*
>>>
>>>         Tomohito Nakayama
>>>         tomonaka@basil.ocn.ne.jp
>>>         tomohito@rose.zero.ad.jp
>>>         tmnk@apache.org
>>>
>>>         Naka
>>>         http://www5.ocn.ne.jp/~tomohito/TopPage.html
>>>
>>> */
>>> ----- Original Message ----- From: "David W. Van Couvering" 
>>> <Da...@Sun.COM>
>>> To: "Derby Development" <de...@db.apache.org>
>>> Sent: Friday, October 07, 2005 12:40 PM
>>> Subject: Re: Discussions on Wiki - WAS Re: SQL functions, procedures 
>>> and PSM - a possible approach
>>>
>>>
>>>> I'm getting a little concerned, it feels a little quiet over there 
>>>> in the corner with Tomohito and I, and I was about to propose with 
>>>> Tomohito that we move it back to the list.
>>>>
>>>> David
>>>>
>>>> Daniel John Debrunner wrote:
>>>>
>>>>> David W. Van Couvering wrote:
>>>>>
>>>>>
>>>>>> This sounds great, Dan!  Is this a good candidate for putting up 
>>>>>> on the
>>>>>> Wiki site as a proposal?
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> Is anyone else concerned by the movement of discussion to the wiki for
>>>>> the common code stuff? The Apache way is for discussions to occur 
>>>>> on the
>>>>> mailing lists. It seems to me that the wiki is a great way to 
>>>>> summarize
>>>>> such discussions, but not to hold them. A wiki page related to a
>>>>> discussion can provide a very useful single overview, something that
>>>>> does get lost in mailings as the discussion spreads out.
>>>>>
>>>>> Dan.
>>>>>
>>>>>
>>>>
>>>
>>>
>>> -------------------------------------------------------------------------------- 
>>>
>>>
>>>
>>> No virus found in this incoming message.
>>> Checked by AVG Anti-Virus.
>>> Version: 7.0.344 / Virus Database: 267.11.13/123 - Release Date: 
>>> 2005/10/06
>>>
>>>
>>>
>>
> 
> 
> -------------------------------------------------------------------------------- 
> 
> 
> 
> No virus found in this incoming message.
> Checked by AVG Anti-Virus.
> Version: 7.0.344 / Virus Database: 267.11.13/124 - Release Date: 2005/10/07
> 
> 
>