You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@qpid.apache.org by "Gordon Sim (JIRA)" <qp...@incubator.apache.org> on 2010/03/05 12:55:27 UTC

[jira] Created: (QPID-2432) org.apache.qpid.client.XAResourceImpl doesn't handle get-/set- TransactionTimeout correctly

org.apache.qpid.client.XAResourceImpl doesn't handle get-/set- TransactionTimeout correctly
-------------------------------------------------------------------------------------------

                 Key: QPID-2432
                 URL: https://issues.apache.org/jira/browse/QPID-2432
             Project: Qpid
          Issue Type: Bug
          Components: Java Client
            Reporter: Gordon Sim
            Assignee: Rajith Attapattu


The XAResource interface[1] defines the transaction timeout to be a property of the resource itself, and not tied to any particular XID. In AMQP 0-10 however the DtxSetTimeout method is for a specific XID. At present org.apache.qpid.client.XAResourceImpl records the XID currently associated with the resource instance and uses that to implement get-/set- TransactionTimeout(). There are a couple of issues with this approach:

(a) the associated xid is not nulled on committing the transaction, meaning that a call to setTransactionTimeout() immediately after a commit() will result in a request to the broker to set the timeout on that xid which violates the AMQP 0-10 protocol

(b) the timeout set by a call to setTransactionTimeout() will only have effect on the currently associated xid which seems to violate the XAResource interfaces contract

[1] http://java.sun.com/j2ee/sdk_1.3/techdocs/api/javax/transaction/xa/XAResource.html#setTransactionTimeout%28int%29

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


---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org


[jira] Commented: (QPID-2432) org.apache.qpid.client.XAResourceImpl doesn't handle get-/set- TransactionTimeout correctly

Posted by "Rajith Attapattu (JIRA)" <qp...@incubator.apache.org>.
    [ https://issues.apache.org/jira/browse/QPID-2432?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12842116#action_12842116 ] 

Rajith Attapattu commented on QPID-2432:
----------------------------------------

I added fix in rev 919666 in Qpid trunk.

Modified the XAResourceImpl to maintain the timeout value and set it to any XID in the start method if the time value > 0
Also the XID nulled after commit, rollback and forget, to prevent a timeout being set on an invalid xid.
The setTimeout method will only set the timeout if xid is not null and if the timeout value is different from the previous value.

Modified the test cases in FaultTest to adhere to the correct behaviour and also added a new test case to cover the issue mentioned in the JIRA.


> org.apache.qpid.client.XAResourceImpl doesn't handle get-/set- TransactionTimeout correctly
> -------------------------------------------------------------------------------------------
>
>                 Key: QPID-2432
>                 URL: https://issues.apache.org/jira/browse/QPID-2432
>             Project: Qpid
>          Issue Type: Bug
>          Components: Java Client
>            Reporter: Gordon Sim
>            Assignee: Rajith Attapattu
>
> The XAResource interface[1] defines the transaction timeout to be a property of the resource itself, and not tied to any particular XID. In AMQP 0-10 however the DtxSetTimeout method is for a specific XID. At present org.apache.qpid.client.XAResourceImpl records the XID currently associated with the resource instance and uses that to implement get-/set- TransactionTimeout(). There are a couple of issues with this approach:
> (a) the associated xid is not nulled on committing the transaction, meaning that a call to setTransactionTimeout() immediately after a commit() will result in a request to the broker to set the timeout on that xid which violates the AMQP 0-10 protocol
> (b) the timeout set by a call to setTransactionTimeout() will only have effect on the currently associated xid which seems to violate the XAResource interfaces contract
> [1] http://java.sun.com/j2ee/sdk_1.3/techdocs/api/javax/transaction/xa/XAResource.html#setTransactionTimeout%28int%29

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


---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org


[jira] Commented: (QPID-2432) org.apache.qpid.client.XAResourceImpl doesn't handle get-/set- TransactionTimeout correctly

Posted by "Gordon Sim (JIRA)" <qp...@incubator.apache.org>.
    [ https://issues.apache.org/jira/browse/QPID-2432?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12841913#action_12841913 ] 

Gordon Sim commented on QPID-2432:
----------------------------------

correction: DtxSetTimeout doesn't allow a non-exceptional return status where the timeout is not valid, so the concern with option (a) is not relevant.

> org.apache.qpid.client.XAResourceImpl doesn't handle get-/set- TransactionTimeout correctly
> -------------------------------------------------------------------------------------------
>
>                 Key: QPID-2432
>                 URL: https://issues.apache.org/jira/browse/QPID-2432
>             Project: Qpid
>          Issue Type: Bug
>          Components: Java Client
>            Reporter: Gordon Sim
>            Assignee: Rajith Attapattu
>
> The XAResource interface[1] defines the transaction timeout to be a property of the resource itself, and not tied to any particular XID. In AMQP 0-10 however the DtxSetTimeout method is for a specific XID. At present org.apache.qpid.client.XAResourceImpl records the XID currently associated with the resource instance and uses that to implement get-/set- TransactionTimeout(). There are a couple of issues with this approach:
> (a) the associated xid is not nulled on committing the transaction, meaning that a call to setTransactionTimeout() immediately after a commit() will result in a request to the broker to set the timeout on that xid which violates the AMQP 0-10 protocol
> (b) the timeout set by a call to setTransactionTimeout() will only have effect on the currently associated xid which seems to violate the XAResource interfaces contract
> [1] http://java.sun.com/j2ee/sdk_1.3/techdocs/api/javax/transaction/xa/XAResource.html#setTransactionTimeout%28int%29

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


---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org


[jira] Commented: (QPID-2432) org.apache.qpid.client.XAResourceImpl doesn't handle get-/set- TransactionTimeout correctly

Posted by "Gordon Sim (JIRA)" <qp...@incubator.apache.org>.
    [ https://issues.apache.org/jira/browse/QPID-2432?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12841828#action_12841828 ] 

Gordon Sim commented on QPID-2432:
----------------------------------

There are a number of possible solutions:

(a) maintain a timeout in org.apache.qpid.client.XAResourceImpl independent of the xid association, and apply that timeout via a DtxSetTimeout whenever a new xid association is made; the only issue here is that there is no guarantee that the timeout will be accepted by the broker at that point and so the XAResource contract could still be violated in some circumstances

(b) clear the associated xid once the transaction commits or is rolled-back; this will at least avoid the first problem in the bug description, but doesn't address the second

(c) don't support transaction timeouts at all; this reduces functionality but would not violate the XAResource contract

My own inclination is to support both (a) and (c) by having a configuration option that disables timeouts completely. That allows the functionality to be used in cases where the deviation from contract is not an issue while providing the ability to enforce strict compliance with JTA.

> org.apache.qpid.client.XAResourceImpl doesn't handle get-/set- TransactionTimeout correctly
> -------------------------------------------------------------------------------------------
>
>                 Key: QPID-2432
>                 URL: https://issues.apache.org/jira/browse/QPID-2432
>             Project: Qpid
>          Issue Type: Bug
>          Components: Java Client
>            Reporter: Gordon Sim
>            Assignee: Rajith Attapattu
>
> The XAResource interface[1] defines the transaction timeout to be a property of the resource itself, and not tied to any particular XID. In AMQP 0-10 however the DtxSetTimeout method is for a specific XID. At present org.apache.qpid.client.XAResourceImpl records the XID currently associated with the resource instance and uses that to implement get-/set- TransactionTimeout(). There are a couple of issues with this approach:
> (a) the associated xid is not nulled on committing the transaction, meaning that a call to setTransactionTimeout() immediately after a commit() will result in a request to the broker to set the timeout on that xid which violates the AMQP 0-10 protocol
> (b) the timeout set by a call to setTransactionTimeout() will only have effect on the currently associated xid which seems to violate the XAResource interfaces contract
> [1] http://java.sun.com/j2ee/sdk_1.3/techdocs/api/javax/transaction/xa/XAResource.html#setTransactionTimeout%28int%29

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


---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org