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 (Created) (JIRA)" <ji...@apache.org> on 2012/02/03 06:55:53 UTC

[jira] [Created] (QPID-3806) QpidRASessionFactoryImpl closeSession() method incorrectly calls remove on HashSet

QpidRASessionFactoryImpl closeSession() method incorrectly calls remove on HashSet 
-----------------------------------------------------------------------------------

                 Key: QPID-3806
                 URL: https://issues.apache.org/jira/browse/QPID-3806
             Project: Qpid
          Issue Type: Bug
          Components: JCA
         Environment: All OS platforms, Geronimo 2.x AS
            Reporter: Weston M. Price
            Assignee: Weston M. Price
             Fix For: 0.15


Currently in the QpidRASessionFactoryImpl when a session is closed we call _sessions.remove(Session) to remove the Session from the HashSet. This HashSet is used to ensure that we conform to J2EE1.4 6.6 spec where only one session can be created for a connection in a JEE environment. Being that HashSet uses the equals() method to determine if the object is in the set, this does not work for application servers that Proxy the session. As such, the underlying session is never removed from the HashSet and attempting any other operation on the connection fails being that the adapter thinks that multiple sessions exist. Since we only use the HashSet to prevent multiple session creation, we should call _sessions.clear() on a close to ensure the correct behavior.

Also, any direct use of QpidRASessionImpl should be refactored to use the QpidRASession interface rather than the Impl class as this will cause ClassCastExceptions when used with a Proxy.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
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-3806) QpidRASessionFactoryImpl closeSession() method incorrectly calls remove on HashSet

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

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

    Attachment: QPID-3806.patch

Patch for QPID-3806 fixes session issues in JEE environments with Proxy objects.
                
> QpidRASessionFactoryImpl closeSession() method incorrectly calls remove on HashSet 
> -----------------------------------------------------------------------------------
>
>                 Key: QPID-3806
>                 URL: https://issues.apache.org/jira/browse/QPID-3806
>             Project: Qpid
>          Issue Type: Bug
>          Components: JCA
>         Environment: All OS platforms, Geronimo 2.x AS
>            Reporter: Weston M. Price
>            Assignee: Weston M. Price
>             Fix For: 0.15
>
>         Attachments: QPID-3806.patch
>
>
> Currently in the QpidRASessionFactoryImpl when a session is closed we call _sessions.remove(Session) to remove the Session from the HashSet. This HashSet is used to ensure that we conform to J2EE1.4 6.6 spec where only one session can be created for a connection in a JEE environment. Being that HashSet uses the equals() method to determine if the object is in the set, this does not work for application servers that Proxy the session. As such, the underlying session is never removed from the HashSet and attempting any other operation on the connection fails being that the adapter thinks that multiple sessions exist. Since we only use the HashSet to prevent multiple session creation, we should call _sessions.clear() on a close to ensure the correct behavior.
> Also, any direct use of QpidRASessionImpl should be refactored to use the QpidRASession interface rather than the Impl class as this will cause ClassCastExceptions when used with a Proxy.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
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-3806) QpidRASessionFactoryImpl closeSession() method incorrectly calls remove on HashSet

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

Weston M. Price resolved QPID-3806.
-----------------------------------

    Resolution: Fixed

Fixed in trunk with provided patch.
                
> QpidRASessionFactoryImpl closeSession() method incorrectly calls remove on HashSet 
> -----------------------------------------------------------------------------------
>
>                 Key: QPID-3806
>                 URL: https://issues.apache.org/jira/browse/QPID-3806
>             Project: Qpid
>          Issue Type: Bug
>          Components: JCA
>         Environment: All OS platforms, Geronimo 2.x AS
>            Reporter: Weston M. Price
>            Assignee: Weston M. Price
>             Fix For: 0.15
>
>         Attachments: QPID-3806.patch
>
>
> Currently in the QpidRASessionFactoryImpl when a session is closed we call _sessions.remove(Session) to remove the Session from the HashSet. This HashSet is used to ensure that we conform to J2EE1.4 6.6 spec where only one session can be created for a connection in a JEE environment. Being that HashSet uses the equals() method to determine if the object is in the set, this does not work for application servers that Proxy the session. As such, the underlying session is never removed from the HashSet and attempting any other operation on the connection fails being that the adapter thinks that multiple sessions exist. Since we only use the HashSet to prevent multiple session creation, we should call _sessions.clear() on a close to ensure the correct behavior.
> Also, any direct use of QpidRASessionImpl should be refactored to use the QpidRASession interface rather than the Impl class as this will cause ClassCastExceptions when used with a Proxy.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@qpid.apache.org
For additional commands, e-mail: dev-help@qpid.apache.org