5 Replies Latest reply on Oct 4, 2005 9:31 AM by pwnell

    matchManagedConnections() does not get called

    pwnell

      I am writing a JCA adaptor usinc CCI to connect to a remote CORBA system. I have implemented the ManagedConnection* and Connection* interfaces. In createManagedConnection() I return a new instance of ManagedConnectionImpl. However, no matter what I do matchManagedConnections() is *never* called. For every call to ConnectionFactoryImpl.getConnection() the ConnectionManager *always* calls createManagedConnection(). I am not using container managed security, so Subject is null. The ConnectionRequestInfo object I create in the ConnectionFactoryImpl class is exactly the same one throughout all calls. There is only one ManagedConnectionFactoryImpl class.

      AFAIK JBoss uses ManagedConnectionFactoryImpl and ConnectionRequestInfo to match connections internally. If this is the case, how come it does not see the new connection request as matching one of those already created in the pool? I have read through this whole forum and the only response I saw was "that means JBoss could not find a suitable connection". That means nothing. What precisely is classified as a "suitable connection"?

      This is very urgent. And yes - I have RTFM and I have purchased the documentation.

        • 1. Re: matchManagedConnections() does not get called
          pwnell

          I can see that all connections are going into the same pool:

          2005-09-29 12:00:38,919 TRACE [org.jboss.resource.connectionmanager.JBossManagedConnectionPool] Getting connection from pool org.jboss.resource.connectionmanager.NoTxConnectionManager$NoTxConnectionEventListener@14c8822[state=NORMAL mc=za.vsp.icaprar.spi.spi.iCapSPIManagedConnection@17d8769 handles=0 lastUse=1127988038918 permit=true trackByTx=false mcp=org.jboss.resource.connectionmanager.JBossManagedConnectionPool$OnePool@11af7bb context=org.jboss.resource.connectionmanager.InternalManagedConnectionPool@17e4cec] [InUse/Available/Max]: [3/17/20]

          Any ideas?

          • 2. Re: matchManagedConnections() does not get called
            pwnell

            Just one more note - I am *not* closing the connections since I need to share this ManagedConnection across many different logical connections. If I close the connection then matchManagedConnections() is called, but what help is that if I cannot share my ManagedConnection objects?

            • 3. Re: matchManagedConnections() does not get called
              zibi101

              As far as I can gather you have to fire events (and set connectionHandle property) to inform container that you want to free managedConnection from client connection and enable the container to put it into pool. Earlier get an listener through addConnectionEventListener method of course.

              • 4. Re: matchManagedConnections() does not get called
                pwnell

                 

                "zibi101" wrote:
                As far as I can gather you have to fire events (and set connectionHandle property) to inform container that you want to free managedConnection from client connection and enable the container to put it into pool. Earlier get an listener through addConnectionEventListener method of course.


                Thanks for taking the time to respond. I have implemented the listener interface and do send out the close notifications. This causes the connection to be released back in to the pool. However, what I want is something different. If I have created one managed connection, and lets assume it is not in the Container's pool. I have two concurrent getConnection() requests from two clients. I want to share this single ManagedConnection with both those clients - i.e. have two Connection instances reference the same ManagedConnection instance. JBoss only allows me to use a ManagedConnection if there is no active logical connections associated with it. I want the oposite.....

                • 5. Re: matchManagedConnections() does not get called
                  pwnell

                  sorry that should have read "...and lets assume it is NOW in the Container's pool..."