3 Replies Latest reply on Mar 13, 2003 10:45 PM by davidjencks

    Multiple ManagedConnection instances of single physical pipe

    darranl


      There is a comment in the JCA specification saying:-

      Note: The connector architecture allows one or more ManagedConnection instances to be multiplexed over a single physical pipe to an EIS. However, for simplicity, this specification describes a ManagedConnection instance as being mapped 1-1 to a physical connection.

      Actually associating the different ManagedConnection instances with the same physical pipe does not look as if it would be a problem.

      To actually allow multiple messages to be sent down the same pipe I think that an additional thread is required with wait / notify calls to allow the responses to be matched up with the original request.

      Would this be allowed in a J2EE resource adapter or is it only the application server that is allowed to handle Threads?

      Has anyone else had any experience implementing a resource adapter that multiplexes multiple messages over a single pipe?

        • 1. Re: Multiple ManagedConnection instances of single physical
          davidjencks

          You can make a stupid adapter that does synchronous calls over the same pipe without any more threads. In JBoss you won't get into trouble if your adapter creates its own threads. The jca 1.5 spec includes explicite thread pooling features (work interface) so that the adapter can use lots of threads but let the app server control their usage.

          • 2. Re: Multiple ManagedConnection instances of single physical
            darranl

            As a second part of this I have seen in the JCA specification that the application server can share (Optional) the ManagedConnection across multiple connections requests.

            Do you have any plans for this to be supported within JBoss?

            • 3. Re: Multiple ManagedConnection instances of single physical
              davidjencks

              I have some trouble understanding what the spec is talking about with that. With local transactions, you have to supply handles to the same ManagedConnection for all connection requests within a single tx. Obviously, you can't associate a single connection with more than one tx at a time. I used to encourage xa connections to remain associated with a tx for the shortest possible length of time to improve concurrency, but it turns out that no available xadatasources allow you to do that so I made it optional. (track-connection-by-tx flag).

              If you have another scenario that you can describe as connection sharing, please explain. Otherwise, I think we have always shared connections at least as much as possible.