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 "Kathey Marsden (JIRA)" <ji...@apache.org> on 2009/04/03 01:13:13 UTC
[jira] Created: (DERBY-4141) XAExceptions thrown by Derby can have
errorCode 0
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.4.2.0, 10.3.3.0, 10.2.1.6, 10.1.3.1
Reporter: Kathey Marsden
Fix For: 10.5.1.1, 10.6.0.0
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.
[jira] Assigned: (DERBY-4141) XAExceptions thrown by Derby can have
errorCode 0
Posted by "Kathey Marsden (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/DERBY-4141?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Kathey Marsden reassigned DERBY-4141:
-------------------------------------
Assignee: Kathey Marsden
> 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
> Reporter: Kathey Marsden
> Assignee: Kathey Marsden
> Fix For: 10.5.1.1, 10.6.0.0
>
>
> 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.
[jira] Updated: (DERBY-4141) XAExceptions thrown by Derby can have
errorCode 0
Posted by "Kathey Marsden (JIRA)" <ji...@apache.org>.
[ 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.
[jira] Updated: (DERBY-4141) XAExceptions thrown by Derby can have
errorCode 0
Posted by "Kathey Marsden (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/DERBY-4141?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Kathey Marsden updated DERBY-4141:
----------------------------------
Affects Version/s: 10.6.0.0
10.5.1.1
Fix Version/s: (was: 10.5.1.1)
(was: 10.6.0.0)
> 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
>
> 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.
[jira] Commented: (DERBY-4141) XAExceptions thrown by Derby can
have errorCode 0
Posted by "Kathey Marsden (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/DERBY-4141?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12697664#action_12697664 ]
Kathey Marsden commented on DERBY-4141:
---------------------------------------
I see am.SqlCode has the disconnect exception at 40000, so I could use XAER_RMFAIL for those but I think that severe exceptions from the server don't get that code.
> 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.
[jira] Closed: (DERBY-4141) XAExceptions thrown by Derby can have
errorCode 0
Posted by "Kathey Marsden (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/DERBY-4141?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Kathey Marsden closed DERBY-4141.
---------------------------------
Resolution: Fixed
Fix Version/s: 10.6.0.0
10.5.1.1
Myrna asked me to pre-close this issue so it makes the 10.5.1.1 release notes. I actually plan to check into 10.5 tomorrow morning after checking the nightly runs.
> 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
> Fix For: 10.5.1.1, 10.6.0.0
>
> Attachments: derby-4141_diff.txt, 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.
[jira] Commented: (DERBY-4141) XAExceptions thrown by Derby can
have errorCode 0
Posted by "Kathey Marsden (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/DERBY-4141?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12697671#action_12697671 ]
Kathey Marsden commented on DERBY-4141:
---------------------------------------
Just closing the XAConnection gives me a good enough reproduction for the XAER_RMFAIL case and in that case the XAER_RMFAIL errrorCode seems to get transfered properly to client.
> 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.
[jira] Updated: (DERBY-4141) XAExceptions thrown by Derby can have
errorCode 0
Posted by "Kathey Marsden (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/DERBY-4141?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Kathey Marsden updated DERBY-4141:
----------------------------------
Fix Version/s: 10.4.2.1
10.3.3.1
> 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
> Fix For: 10.3.3.1, 10.4.2.1, 10.5.1.1, 10.6.0.0
>
> Attachments: derby-4141_diff.txt, 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.
[jira] Updated: (DERBY-4141) XAExceptions thrown by Derby can have
errorCode 0
Posted by "Kathey Marsden (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/DERBY-4141?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Kathey Marsden updated DERBY-4141:
----------------------------------
Derby Info: [Patch Available]
Tests passed. please review.
> 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_diff.txt, 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.
[jira] Updated: (DERBY-4141) XAExceptions thrown by Derby can have
errorCode 0
Posted by "Kathey Marsden (JIRA)" <ji...@apache.org>.
[ 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_diff.txt
The attached patch (derby-4141_diff.txt) has the client and embedded changes and adds a test for the XAER_RMFAIL case. I couldn't figure out a case for testing the XAER_RMERR case, (non-session ending exception that causes an xa operation to fail), but if anyone has any ideas, please let me know and I'll add a test for that too.
For client I mapped the disconnect exception to XAException.XAER_RMFAIL and verified that server side exceptions that cause XAExceptions do indeed get the errorCode from the server. I think this resolves my concerns about client side SQLExcetptions.
Running tests now. I would like to backport this change to 10.3. It is a behavior change, but I think a sensible one that is low risk. Please let me know if you have any concerns.
> 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_diff.txt, 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.