You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@qpid.apache.org by "Weston M. Price (JIRA)" <ji...@apache.org> on 2011/05/18 19:12:47 UTC

[jira] [Created] (QPID-3263) Java (org.apache.qpid.client) XAResourceImpl always returns false for isSameRM

Java (org.apache.qpid.client) XAResourceImpl always returns false for isSameRM
------------------------------------------------------------------------------

                 Key: QPID-3263
                 URL: https://issues.apache.org/jira/browse/QPID-3263
             Project: Qpid
          Issue Type: Bug
          Components: Java Client
    Affects Versions: 0.11
         Environment: All OS/hardware platforms as well as current brokers.
            Reporter: Weston M. Price
             Fix For: 0.11


The isSameRM method of org.apache.qpid.client.XAResourceImpl always returns
false.

The javadoc for isSameRM says ..

"This method is called to determine if the resource manager instance
represented by the target object is the same as the resource manager instance
represented by the parameter xares ."

which means isSameRM has to return true when invoked with identical objects
(Java identity). Clearly, these two XA resources are backed by the same
resource manager.

//xaResource1 == xaResource2
XAResource xaResource1 = jmsXAResource;
XAResource xaResource2 = jmsXAResource;

// xaResource1.isSameRM(xaResource2) should be true

Because the Qpid implementation always returns false, it affects resource
enlistment/delistment.

The source code (lines 213 - 217) of org.apache.qpid.client.XAResourceImpl
suggests that this method has not been fully completed.

public boolean isSameRM(XAResource xaResource) throws XAException
{
// TODO : get the server identity of xaResource and compare it with our own one
return false;
}


--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

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


[jira] [Updated] (QPID-3263) Java (org.apache.qpid.client) XAResourceImpl always returns false for isSameRM

Posted by "Weston M. Price (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/QPID-3263?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Weston M. Price updated QPID-3263:
----------------------------------

    Attachment: qpid3263.patch

Adding patch for isSameRM fix.

> Java (org.apache.qpid.client) XAResourceImpl always returns false for isSameRM
> ------------------------------------------------------------------------------
>
>                 Key: QPID-3263
>                 URL: https://issues.apache.org/jira/browse/QPID-3263
>             Project: Qpid
>          Issue Type: Bug
>          Components: Java Client
>    Affects Versions: 0.11
>         Environment: All OS/hardware platforms as well as current brokers.
>            Reporter: Weston M. Price
>             Fix For: 0.11
>
>         Attachments: MRG-00471937.zip, qpid3263.patch
>
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> The isSameRM method of org.apache.qpid.client.XAResourceImpl always returns
> false.
> The javadoc for isSameRM says ..
> "This method is called to determine if the resource manager instance
> represented by the target object is the same as the resource manager instance
> represented by the parameter xares ."
> which means isSameRM has to return true when invoked with identical objects
> (Java identity). Clearly, these two XA resources are backed by the same
> resource manager.
> //xaResource1 == xaResource2
> XAResource xaResource1 = jmsXAResource;
> XAResource xaResource2 = jmsXAResource;
> // xaResource1.isSameRM(xaResource2) should be true
> Because the Qpid implementation always returns false, it affects resource
> enlistment/delistment.
> The source code (lines 213 - 217) of org.apache.qpid.client.XAResourceImpl
> suggests that this method has not been fully completed.
> public boolean isSameRM(XAResource xaResource) throws XAException
> {
> // TODO : get the server identity of xaResource and compare it with our own one
> return false;
> }

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

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


[jira] [Commented] (QPID-3263) Java (org.apache.qpid.client) XAResourceImpl always returns false for isSameRM

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

Gordon Sim commented on QPID-3263:
----------------------------------

Looks fine to me. (I might have been tempted to call the new method getBrokerId() since it returns a string which could potentially be any form of identifier. Very minor and subjective issue though).

> Java (org.apache.qpid.client) XAResourceImpl always returns false for isSameRM
> ------------------------------------------------------------------------------
>
>                 Key: QPID-3263
>                 URL: https://issues.apache.org/jira/browse/QPID-3263
>             Project: Qpid
>          Issue Type: Bug
>          Components: Java Client
>    Affects Versions: 0.11
>         Environment: All OS/hardware platforms as well as current brokers.
>            Reporter: Weston M. Price
>             Fix For: 0.11
>
>         Attachments: MRG-00471937.zip, qpid3263.patch
>
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> The isSameRM method of org.apache.qpid.client.XAResourceImpl always returns
> false.
> The javadoc for isSameRM says ..
> "This method is called to determine if the resource manager instance
> represented by the target object is the same as the resource manager instance
> represented by the parameter xares ."
> which means isSameRM has to return true when invoked with identical objects
> (Java identity). Clearly, these two XA resources are backed by the same
> resource manager.
> //xaResource1 == xaResource2
> XAResource xaResource1 = jmsXAResource;
> XAResource xaResource2 = jmsXAResource;
> // xaResource1.isSameRM(xaResource2) should be true
> Because the Qpid implementation always returns false, it affects resource
> enlistment/delistment.
> The source code (lines 213 - 217) of org.apache.qpid.client.XAResourceImpl
> suggests that this method has not been fully completed.
> public boolean isSameRM(XAResource xaResource) throws XAException
> {
> // TODO : get the server identity of xaResource and compare it with our own one
> return false;
> }

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

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


[jira] [Commented] (QPID-3263) Java (org.apache.qpid.client) XAResourceImpl always returns false for isSameRM

Posted by "Weston M. Price (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/QPID-3263?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13035496#comment-13035496 ] 

Weston M. Price commented on QPID-3263:
---------------------------------------

Note, this was reported internally at RedHat via a customer. I am also attaching a test case as provided by the customer that shows the issue. I am working on a patch to fix the issue that I will submit to the review board once complete.



> Java (org.apache.qpid.client) XAResourceImpl always returns false for isSameRM
> ------------------------------------------------------------------------------
>
>                 Key: QPID-3263
>                 URL: https://issues.apache.org/jira/browse/QPID-3263
>             Project: Qpid
>          Issue Type: Bug
>          Components: Java Client
>    Affects Versions: 0.11
>         Environment: All OS/hardware platforms as well as current brokers.
>            Reporter: Weston M. Price
>             Fix For: 0.11
>
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> The isSameRM method of org.apache.qpid.client.XAResourceImpl always returns
> false.
> The javadoc for isSameRM says ..
> "This method is called to determine if the resource manager instance
> represented by the target object is the same as the resource manager instance
> represented by the parameter xares ."
> which means isSameRM has to return true when invoked with identical objects
> (Java identity). Clearly, these two XA resources are backed by the same
> resource manager.
> //xaResource1 == xaResource2
> XAResource xaResource1 = jmsXAResource;
> XAResource xaResource2 = jmsXAResource;
> // xaResource1.isSameRM(xaResource2) should be true
> Because the Qpid implementation always returns false, it affects resource
> enlistment/delistment.
> The source code (lines 213 - 217) of org.apache.qpid.client.XAResourceImpl
> suggests that this method has not been fully completed.
> public boolean isSameRM(XAResource xaResource) throws XAException
> {
> // TODO : get the server identity of xaResource and compare it with our own one
> return false;
> }

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

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


[jira] [Commented] (QPID-3263) Java (org.apache.qpid.client) XAResourceImpl always returns false for isSameRM

Posted by "Weston M. Price (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/QPID-3263?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13073648#comment-13073648 ] 

Weston M. Price commented on QPID-3263:
---------------------------------------

why are you awake? 






> Java (org.apache.qpid.client) XAResourceImpl always returns false for isSameRM
> ------------------------------------------------------------------------------
>
>                 Key: QPID-3263
>                 URL: https://issues.apache.org/jira/browse/QPID-3263
>             Project: Qpid
>          Issue Type: Bug
>          Components: Java Client
>    Affects Versions: 0.11
>         Environment: All OS/hardware platforms as well as current brokers.
>            Reporter: Weston M. Price
>             Fix For: 0.11
>
>         Attachments: MRG-00471937.zip, qpid3263.patch
>
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> The isSameRM method of org.apache.qpid.client.XAResourceImpl always returns
> false.
> The javadoc for isSameRM says ..
> "This method is called to determine if the resource manager instance
> represented by the target object is the same as the resource manager instance
> represented by the parameter xares ."
> which means isSameRM has to return true when invoked with identical objects
> (Java identity). Clearly, these two XA resources are backed by the same
> resource manager.
> //xaResource1 == xaResource2
> XAResource xaResource1 = jmsXAResource;
> XAResource xaResource2 = jmsXAResource;
> // xaResource1.isSameRM(xaResource2) should be true
> Because the Qpid implementation always returns false, it affects resource
> enlistment/delistment.
> The source code (lines 213 - 217) of org.apache.qpid.client.XAResourceImpl
> suggests that this method has not been fully completed.
> public boolean isSameRM(XAResource xaResource) throws XAException
> {
> // TODO : get the server identity of xaResource and compare it with our own one
> return false;
> }

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

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


[jira] [Updated] (QPID-3263) Java (org.apache.qpid.client) XAResourceImpl always returns false for isSameRM

Posted by "Weston M. Price (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/QPID-3263?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Weston M. Price updated QPID-3263:
----------------------------------

    Attachment: MRG-00471937.zip

Test case showing incorrect or incomplete isSameRM implementation in client XAResourceImpl.java

> Java (org.apache.qpid.client) XAResourceImpl always returns false for isSameRM
> ------------------------------------------------------------------------------
>
>                 Key: QPID-3263
>                 URL: https://issues.apache.org/jira/browse/QPID-3263
>             Project: Qpid
>          Issue Type: Bug
>          Components: Java Client
>    Affects Versions: 0.11
>         Environment: All OS/hardware platforms as well as current brokers.
>            Reporter: Weston M. Price
>             Fix For: 0.11
>
>         Attachments: MRG-00471937.zip
>
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> The isSameRM method of org.apache.qpid.client.XAResourceImpl always returns
> false.
> The javadoc for isSameRM says ..
> "This method is called to determine if the resource manager instance
> represented by the target object is the same as the resource manager instance
> represented by the parameter xares ."
> which means isSameRM has to return true when invoked with identical objects
> (Java identity). Clearly, these two XA resources are backed by the same
> resource manager.
> //xaResource1 == xaResource2
> XAResource xaResource1 = jmsXAResource;
> XAResource xaResource2 = jmsXAResource;
> // xaResource1.isSameRM(xaResource2) should be true
> Because the Qpid implementation always returns false, it affects resource
> enlistment/delistment.
> The source code (lines 213 - 217) of org.apache.qpid.client.XAResourceImpl
> suggests that this method has not been fully completed.
> public boolean isSameRM(XAResource xaResource) throws XAException
> {
> // TODO : get the server identity of xaResource and compare it with our own one
> return false;
> }

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

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


[jira] [Resolved] (QPID-3263) Java (org.apache.qpid.client) XAResourceImpl always returns false for isSameRM

Posted by "Rajith Attapattu (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/QPID-3263?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Rajith Attapattu resolved QPID-3263.
------------------------------------

       Resolution: Fixed
    Fix Version/s:     (was: 0.11)
                   0.14

Applied the patch from Weston Price with the following modifications.

1. The test case now extends QpidBrokerTestCase instead of TestCase to ensure that it can run under the automated ant builds.

2. Added an additional case to testIsSameRMMultiCF to ensure that isSameRM() returns false for two XAResources created from two different brokers.

3. Excluded this test from the Java test profiles.

> Java (org.apache.qpid.client) XAResourceImpl always returns false for isSameRM
> ------------------------------------------------------------------------------
>
>                 Key: QPID-3263
>                 URL: https://issues.apache.org/jira/browse/QPID-3263
>             Project: Qpid
>          Issue Type: Bug
>          Components: Java Client
>    Affects Versions: 0.11
>         Environment: All OS/hardware platforms as well as current brokers.
>            Reporter: Weston M. Price
>             Fix For: 0.14
>
>         Attachments: MRG-00471937.zip, qpid3263.patch
>
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> The isSameRM method of org.apache.qpid.client.XAResourceImpl always returns
> false.
> The javadoc for isSameRM says ..
> "This method is called to determine if the resource manager instance
> represented by the target object is the same as the resource manager instance
> represented by the parameter xares ."
> which means isSameRM has to return true when invoked with identical objects
> (Java identity). Clearly, these two XA resources are backed by the same
> resource manager.
> //xaResource1 == xaResource2
> XAResource xaResource1 = jmsXAResource;
> XAResource xaResource2 = jmsXAResource;
> // xaResource1.isSameRM(xaResource2) should be true
> Because the Qpid implementation always returns false, it affects resource
> enlistment/delistment.
> The source code (lines 213 - 217) of org.apache.qpid.client.XAResourceImpl
> suggests that this method has not been fully completed.
> public boolean isSameRM(XAResource xaResource) throws XAException
> {
> // TODO : get the server identity of xaResource and compare it with our own one
> return false;
> }

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

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