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 "Knut Anders Hatlen (JIRA)" <ji...@apache.org> on 2007/05/24 21:35:16 UTC

[jira] Created: (DERBY-2692) Client driver doesn't chain exceptions received from the server

Client driver doesn't chain exceptions received from the server
---------------------------------------------------------------

                 Key: DERBY-2692
                 URL: https://issues.apache.org/jira/browse/DERBY-2692
             Project: Derby
          Issue Type: Bug
          Components: JDBC, Network Client
    Affects Versions: 10.2.2.0, 10.2.1.6, 10.3.0.0
            Reporter: Knut Anders Hatlen
         Assigned To: Knut Anders Hatlen
            Priority: Minor


When the client driver receives a chain of exceptions from the server, it generates one exception with the messages from all the server-side exceptions concatenated into one message. No next-exception chain is set up on the client. See the description of DERBY-1440 for an example.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (DERBY-2692) Client driver doesn't chain exceptions received from the server

Posted by "Knut Anders Hatlen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-2692?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Knut Anders Hatlen updated DERBY-2692:
--------------------------------------

    Attachment: d2692.stat
                d2692.diff

Attaching a patch which makes the client recreate the chain of
exceptions sent by the server instead of concatenating the messages.

Derbyall and suites.All ran cleanly on JDK5 and JDK6.

Description of the changes:

* java/client/org/apache/derby/client/am/Sqlca.java:

  - added a message number parameter to the methods that retrieved
    mesage and SQL state

  - fixed SqlErrmc parsing (used the correct delimiter) and renamed
    sqlErrmcTokens_ to sqlErrmcMessages_ since the SqlErrmc was split
    into its separate messages, not its tokens

  - added a string array called sqlStates_, which keeps the SQL states
    for each message in the chain

* java/client/org/apache/derby/client/am/SqlException.java

  - added a message number field to keep track of which message in the
    SQLCA to use

  - changed the constructor that takes an Sqlca argument so that it
    recursively builds the chain of exceptions when the Sqlca contains
    many messages

* java/client/org/apache/derby/client/am/ExceptionFormatter.java

  - removed the printing of SqlErrmcTokens in printTrace(), because
    (a) that method was renamed, and (b) it contains the exact same
    information as SqlErrmc which is printed anyway

* java/testing/org/apache/derbyTesting/junit/BaseJDBCTestCase.java

  - changed assertSQLState() so that it checks nested exceptions on
    the client the same way as on embedded

* java/testing/org/apache/derbyTesting/functionTests/tests/lang/ProcedureInTriggerTest.java

  - enabled an assert that previously only worked on embedded

> Client driver doesn't chain exceptions received from the server
> ---------------------------------------------------------------
>
>                 Key: DERBY-2692
>                 URL: https://issues.apache.org/jira/browse/DERBY-2692
>             Project: Derby
>          Issue Type: Bug
>          Components: JDBC, Network Client
>    Affects Versions: 10.2.1.6, 10.2.2.0, 10.3.0.0
>            Reporter: Knut Anders Hatlen
>            Assignee: Knut Anders Hatlen
>            Priority: Minor
>         Attachments: d2692.diff, d2692.stat
>
>
> When the client driver receives a chain of exceptions from the server, it generates one exception with the messages from all the server-side exceptions concatenated into one message. No next-exception chain is set up on the client. See the description of DERBY-1440 for an example.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (DERBY-2692) Client driver doesn't chain exceptions received from the server

Posted by "Knut Anders Hatlen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-2692?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Knut Anders Hatlen updated DERBY-2692:
--------------------------------------

       Derby Info:   (was: [Patch Available])
    Fix Version/s: 10.3.0.0

Committed revision 543090.

> Client driver doesn't chain exceptions received from the server
> ---------------------------------------------------------------
>
>                 Key: DERBY-2692
>                 URL: https://issues.apache.org/jira/browse/DERBY-2692
>             Project: Derby
>          Issue Type: Bug
>          Components: JDBC, Network Client
>    Affects Versions: 10.2.1.6, 10.2.2.0, 10.3.0.0
>            Reporter: Knut Anders Hatlen
>            Assignee: Knut Anders Hatlen
>            Priority: Minor
>             Fix For: 10.3.0.0
>
>         Attachments: d2692.diff, d2692.stat
>
>
> When the client driver receives a chain of exceptions from the server, it generates one exception with the messages from all the server-side exceptions concatenated into one message. No next-exception chain is set up on the client. See the description of DERBY-1440 for an example.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (DERBY-2692) Client driver doesn't chain exceptions received from the server

Posted by "Knut Anders Hatlen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-2692?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Knut Anders Hatlen updated DERBY-2692:
--------------------------------------

    Attachment: d2692-2.stat
                d2692-2.diff

Attaching a new patch which makes the client driver use initCause() in addition to setNextException() when the cause is an SQLException. It also removes the instance variable called throwable_ in SqlException and XaException and uses initCause()/getCause() instead, and it removes some code handling JVM<1.4 that is no longer needed. SqlExceptionTest had a test case which needed modifications because it tested that getCause() returned null when the cause was an SQLException.

Derbyall and suites.All ran cleanly.

> Client driver doesn't chain exceptions received from the server
> ---------------------------------------------------------------
>
>                 Key: DERBY-2692
>                 URL: https://issues.apache.org/jira/browse/DERBY-2692
>             Project: Derby
>          Issue Type: Bug
>          Components: JDBC, Network Client
>    Affects Versions: 10.2.1.6, 10.2.2.0, 10.3.0.0
>            Reporter: Knut Anders Hatlen
>            Assignee: Knut Anders Hatlen
>            Priority: Minor
>             Fix For: 10.3.0.0
>
>         Attachments: d2692-2.diff, d2692-2.stat, d2692.diff, d2692.stat
>
>
> When the client driver receives a chain of exceptions from the server, it generates one exception with the messages from all the server-side exceptions concatenated into one message. No next-exception chain is set up on the client. See the description of DERBY-1440 for an example.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DERBY-2692) Client driver doesn't chain exceptions received from the server

Posted by "Knut Anders Hatlen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-2692?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12498967 ] 

Knut Anders Hatlen commented on DERBY-2692:
-------------------------------------------

The concatenation of the error messages happens in the stored procedure SYSIBM.SQLCAMESSAGE because the client passes in all the exceptions at once. I think that if the client receives a chain of exceptions, it should call SQLCAMESSAGE once for each exception in the chain and rebuild the exception chain as it was on the server.

The logic in Sqlca.processSqlErrmcTokens() on the client seems to be broken. It tries to split an SQLERRMC message into tokens, but it uses a different token delimiter than the server (server uses \u0014, client uses \u00FF). Therefore, the client always thinks it gets one big token from the server. This doesn't seem to be a big problem, since it would anyway just split it into separate tokens and concatenate the tokens again, but it seems a little strange. If we want the client to split the SQLERRMC into a chain of exceptions, this has to be fixed though.

> Client driver doesn't chain exceptions received from the server
> ---------------------------------------------------------------
>
>                 Key: DERBY-2692
>                 URL: https://issues.apache.org/jira/browse/DERBY-2692
>             Project: Derby
>          Issue Type: Bug
>          Components: JDBC, Network Client
>    Affects Versions: 10.2.1.6, 10.2.2.0, 10.3.0.0
>            Reporter: Knut Anders Hatlen
>         Assigned To: Knut Anders Hatlen
>            Priority: Minor
>
> When the client driver receives a chain of exceptions from the server, it generates one exception with the messages from all the server-side exceptions concatenated into one message. No next-exception chain is set up on the client. See the description of DERBY-1440 for an example.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (DERBY-2692) Client driver doesn't chain exceptions received from the server

Posted by "Knut Anders Hatlen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-2692?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Knut Anders Hatlen updated DERBY-2692:
--------------------------------------

    Derby Info: [Patch Available]

> Client driver doesn't chain exceptions received from the server
> ---------------------------------------------------------------
>
>                 Key: DERBY-2692
>                 URL: https://issues.apache.org/jira/browse/DERBY-2692
>             Project: Derby
>          Issue Type: Bug
>          Components: JDBC, Network Client
>    Affects Versions: 10.2.1.6, 10.2.2.0, 10.3.0.0
>            Reporter: Knut Anders Hatlen
>            Assignee: Knut Anders Hatlen
>            Priority: Minor
>         Attachments: d2692.diff, d2692.stat
>
>
> When the client driver receives a chain of exceptions from the server, it generates one exception with the messages from all the server-side exceptions concatenated into one message. No next-exception chain is set up on the client. See the description of DERBY-1440 for an example.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (DERBY-2692) Client driver doesn't chain exceptions received from the server

Posted by "Knut Anders Hatlen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-2692?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Knut Anders Hatlen resolved DERBY-2692.
---------------------------------------

    Resolution: Fixed
    Derby Info:   (was: [Patch Available])

Committed revision 543428.

> Client driver doesn't chain exceptions received from the server
> ---------------------------------------------------------------
>
>                 Key: DERBY-2692
>                 URL: https://issues.apache.org/jira/browse/DERBY-2692
>             Project: Derby
>          Issue Type: Bug
>          Components: JDBC, Network Client
>    Affects Versions: 10.2.1.6, 10.2.2.0, 10.3.0.0
>            Reporter: Knut Anders Hatlen
>            Assignee: Knut Anders Hatlen
>            Priority: Minor
>             Fix For: 10.3.0.0
>
>         Attachments: d2692-2.diff, d2692-2.stat, d2692.diff, d2692.stat
>
>
> When the client driver receives a chain of exceptions from the server, it generates one exception with the messages from all the server-side exceptions concatenated into one message. No next-exception chain is set up on the client. See the description of DERBY-1440 for an example.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Closed: (DERBY-2692) Client driver doesn't chain exceptions received from the server

Posted by "Knut Anders Hatlen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-2692?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Knut Anders Hatlen closed DERBY-2692.
-------------------------------------


> Client driver doesn't chain exceptions received from the server
> ---------------------------------------------------------------
>
>                 Key: DERBY-2692
>                 URL: https://issues.apache.org/jira/browse/DERBY-2692
>             Project: Derby
>          Issue Type: Bug
>          Components: JDBC, Network Client
>    Affects Versions: 10.2.1.6, 10.2.2.0, 10.3.0.0
>            Reporter: Knut Anders Hatlen
>            Assignee: Knut Anders Hatlen
>            Priority: Minor
>             Fix For: 10.3.0.0
>
>         Attachments: d2692-2.diff, d2692-2.stat, d2692.diff, d2692.stat
>
>
> When the client driver receives a chain of exceptions from the server, it generates one exception with the messages from all the server-side exceptions concatenated into one message. No next-exception chain is set up on the client. See the description of DERBY-1440 for an example.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (DERBY-2692) Client driver doesn't chain exceptions received from the server

Posted by "Knut Anders Hatlen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-2692?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Knut Anders Hatlen updated DERBY-2692:
--------------------------------------

    Derby Info: [Patch Available]

> Client driver doesn't chain exceptions received from the server
> ---------------------------------------------------------------
>
>                 Key: DERBY-2692
>                 URL: https://issues.apache.org/jira/browse/DERBY-2692
>             Project: Derby
>          Issue Type: Bug
>          Components: JDBC, Network Client
>    Affects Versions: 10.2.1.6, 10.2.2.0, 10.3.0.0
>            Reporter: Knut Anders Hatlen
>            Assignee: Knut Anders Hatlen
>            Priority: Minor
>             Fix For: 10.3.0.0
>
>         Attachments: d2692-2.diff, d2692-2.stat, d2692.diff, d2692.stat
>
>
> When the client driver receives a chain of exceptions from the server, it generates one exception with the messages from all the server-side exceptions concatenated into one message. No next-exception chain is set up on the client. See the description of DERBY-1440 for an example.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DERBY-2692) Client driver doesn't chain exceptions received from the server

Posted by "Knut Anders Hatlen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-2692?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12500335 ] 

Knut Anders Hatlen commented on DERBY-2692:
-------------------------------------------

I'm not marking the issue as resolved yet, since I think there is one more change that needs to be made. The embedded driver sets the next exception as cause of the exception with initCause() as well as with setNextException(). The client driver only uses setNextException() if the cause is an SQLException. I think the client should do the same as the embedded driver.

> Client driver doesn't chain exceptions received from the server
> ---------------------------------------------------------------
>
>                 Key: DERBY-2692
>                 URL: https://issues.apache.org/jira/browse/DERBY-2692
>             Project: Derby
>          Issue Type: Bug
>          Components: JDBC, Network Client
>    Affects Versions: 10.2.1.6, 10.2.2.0, 10.3.0.0
>            Reporter: Knut Anders Hatlen
>            Assignee: Knut Anders Hatlen
>            Priority: Minor
>             Fix For: 10.3.0.0
>
>         Attachments: d2692.diff, d2692.stat
>
>
> When the client driver receives a chain of exceptions from the server, it generates one exception with the messages from all the server-side exceptions concatenated into one message. No next-exception chain is set up on the client. See the description of DERBY-1440 for an example.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.