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

Julius Stroffek updated DERBY-2406:
-----------------------------------

    Attachment: d2406.diff

The implementation in derby is alright. I missed the call to 
setXaStateForXAException. The patch provided adds only a comment to the place 
in a code which is mentioned in a description. I added the following comment:

            // The corresponding XA connection association state
            // is changed by setXaStateForXAException inside the call
            // to throwXAException according the error code of the XAException
            // to be thrown.

Hopefully, it may help someone in a future not to miss it as I did.

Feel free to ignore the patch if you find it unnecessary. If nobody applies the 
patch I'll close the issue in a few days.
 

> XAResource.end does not set the XA transaction state correctly when the 
> XAException is thrown
> ---------------------------------------------------------------------------------------------
>
>                 Key: DERBY-2406
>                 URL: https://issues.apache.org/jira/browse/DERBY-2406
>             Project: Derby
>          Issue Type: Bug
>          Components: Network Client
>    Affects Versions: 10.3.0.0
>            Reporter: Julius Stroffek
>         Assigned To: Julius Stroffek
>            Priority: Minor
>             Fix For: 10.3.0.0
>
>         Attachments: d2406.diff
>
>
> As the comments in DERBY-2360 show when calling the XAResource.end the 
> XAException may be thrown even when the transaction was successfully 
> disassociated from the connection but the transaction was marked as rollback 
> only. The code at the end of XAResource.end function does not handle this 
> correctly. It either throws an XAException or sets the connection state to 
> XA_T0_NOT_ASSOCIATED. The corresponding code from NetXAResource.end method is
>         if (rc != XAResource.XA_OK) {
>             throwXAException(rc, false);
>         }else {
>               conn_.setXAState(Connection.XA_T0_NOT_ASSOCIATED);
>         } 

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

Reply via email to