[ 
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:[email protected]

Reply via email to