2 Replies Latest reply on May 12, 2005 6:26 PM by Adrian Brock

    ManagedConnection shared by multiple Connections

    Axel Mueller Newbie

      We are developing a J2EE application where multiple clients (EJBs) can connect simultanously to a device connected via single TCP-style connection. The communication protocol _does_ support concurrent communication of clients over this single connection.
      Using JCA (NoTransaction, Managed) we decided to manage the TCP connection inside a ManagedConnection. EJB clients would retrieve a Connection which possibly uses the same ManagedConnection as another EJB client if both have to communicate with the same device. According to the spec, chapter, multiple Connections sharing a ManagedConnection should be supported.
      However we experienced the following:
      If one EJB requests an Connection a corresponding ManagedConnection is created and the EJB client then executes an Interaction. While the interaction is running, if another EJB client requests a Connection with the same ConnectionSpec, the JBoss ConnectionManager always calls createManagedConnection() on the ManagedConnectionFactory. Since the ManagedConnection represents the communication channel to the device we cannot create a second one. Instead we want to create a new Connection but for the already existing ManagedConnection.
      How could we accomplish this?