db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kathey Marsden (JIRA)" <j...@apache.org>
Subject [jira] Updated: (DERBY-4141) XAExceptions thrown by Derby can have errorCode 0
Date Thu, 09 Apr 2009 20:34:13 GMT

     [ https://issues.apache.org/jira/browse/DERBY-4141?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Kathey Marsden updated DERBY-4141:
----------------------------------

    Attachment: derby-4141_embbeded_diff1.txt

Well these changes look pretty straight forward for embedded. See attached preliminary patch
(derby-4141_embedded_diff1.txt), but looking at the client code in NetXAResource it seems
for any SQLException we use errorCode XAER_RMERR.  I am not sure how to determine if it is
a session ending exception on client. Does anyone know how to do this?

Also, I need a better test to provoke an SQLException within an XA operation.  My current
test case, which shuts down the database causes an assertion on the server and a NPE on the
client when run with network server.  Any ideas on a better test case would be welcome.  I
don't really see the assertion and the NPE as bugs as Derby can't really be so defensive as
to gracefully handle someone shutting the database down from underneath.

The patch is not tested and is not ready for commit, but adapts the client model of setting
both the message and the errorCode for all XAExceptions.  If not one of the SQLStates with
a straightforward mapping, it will set the errrorCode to XAER_RMFAIL for SESSION_SEVERITY
or greater and XAER_RMERR for less severe errors. With the old code for embedded we would
set either the message or the errorCode, but not both.


> XAExceptions thrown by Derby can have errorCode 0 
> --------------------------------------------------
>
>                 Key: DERBY-4141
>                 URL: https://issues.apache.org/jira/browse/DERBY-4141
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.1.3.1, 10.2.1.6, 10.3.3.0, 10.4.2.0, 10.5.1.1, 10.6.0.0
>            Reporter: Kathey Marsden
>            Assignee: Kathey Marsden
>         Attachments: derby-4141_embbeded_diff1.txt
>
>
> When an XAException occurs during xa.start() or other XA operation, because of an SQLException,
we have an errorCode of 0, regardless of the severity.  I would suggest XAER_RMFAIL for SESSION_SEVERITY
or greater and XAER_RMERR for lower severity exceptions. See thread http://www.nabble.com/XAException.errorCode-on-XAException-caused-by-an-SQLException-tt22832423.html
 for more detail and a reproduction.

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


Mime
View raw message