Qpid
  1. Qpid
  2. QPID-3806

QpidRASessionFactoryImpl closeSession() method incorrectly calls remove on HashSet

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.15
    • Component/s: JCA
    • Labels:
      None
    • Environment:

      All OS platforms, Geronimo 2.x AS

      Description

      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.

      1. QPID-3806.patch
        4 kB
        Weston M. Price

        Activity

        Hide
        Weston M. Price added a comment -

        Fixed in trunk with provided patch.

        Show
        Weston M. Price added a comment - Fixed in trunk with provided patch.
        Hide
        Weston M. Price added a comment -

        Patch for QPID-3806 fixes session issues in JEE environments with Proxy objects.

        Show
        Weston M. Price added a comment - Patch for QPID-3806 fixes session issues in JEE environments with Proxy objects.

          People

          • Assignee:
            Weston M. Price
            Reporter:
            Weston M. Price
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development