3 Replies Latest reply on Mar 20, 2002 3:37 AM by ramana

    jboss JCA connection manager not perfect

    ramana Newbie

      Hi all,
      In my project I have implemented JCA1.0( Java Connector Architecture).
      when the user get a connection using javax.resource.cci.ConnectionFactory.getConnection(), I do the following in the implementation.

      Connection conn = (Connection)mgr.allocateConnection(mcf,connInfo);

      So Jboss takes care of asking ManagedConnectionFactory to match or create new connection handles.

      Suppose Jboss do pooling for 10 managed connections.
      The thing is when the user has requested for one more connection (think that its already has 10 mgdconnections opened), the jboss should throw an exception javax.resource.spi.ResourceAllocationException. But it throws some other exception java.lang.IllegalArgumentException..

      As per JCA, Connection mgr should throw ResourceException..
      Is this is a bug? I am using Jboss 3.0 alpha.

      here is the stack trace when I did test..
      [14:10:30,661,Default] java.lang.IllegalArgumentException: How can you manage a null connection?
      [14:10:30,661,Default] at org.jboss.resource.connectionmanager.BaseConnectionManager$ConnectionListener.(BaseConn
      ectionManager.java:246)
      [14:10:30,661,Default] at org.jboss.resource.connectionmanager.BaseConnectionManager$NoTransactionListener.(BaseC
      onnectionManager.java:360)
      [14:10:30,661,Default] at org.jboss.resource.connectionmanager.NoTransConnectionManager.allocateConnection(NoTransConne
      ctionManager.java:73)
      [14:10:30,661,Default] at
      me.company.cci.ConnectionFactoryImpl.getConnection(ConnectionFactoryImpl.java:43)

      any comments would be really appreciable.
      thanks,

      Ramana

        • 1. Re: jboss JCA connection manager not perfect
          ramana Newbie

          HI,
          I use jboss3.0 alpha.
          JBoss never calls ManagedConnection.destory()..
          what is the reason for??
          Am I doing anything wrong??

          It is doing cleanup connections but not destroying connection.
          I checked my-adapter-service.xml,there I could specify cleanup interval but not destroying time references...

          Can anybody help me??

          Thanks in advance,
          Ramana

          • 2. Re: jboss JCA connection manager not perfect
            David Jencks Master

            The pooling code is .... not my favorite. I hadn't seen the lack of blocking/exception problem before. I am working on replacement pooling code and will try to check for this problem in it.

            You should be able to cause your ManagedConnections to be destroyed after a period of inactivity using IdleTimeout. Do you see a need to destroy connections that are of sufficient age even if they are being regularly used? Is the idle timeout working for you?

            Thanks
            david jencks

            • 3. Re: jboss JCA connection manager not perfect
              ramana Newbie

              Hi David,
              thanks if you could check once again pooling code.

              And coming to ManagedConnection.destroy()..
              As you mentioned idle timeout,it does n't work.I put
              IdleTimeoutMinutes=2, but it never called destory() in ManagedConnection, even in a whole day idle time.

              The interesting thing here is after some time( I don't know, only just jboss pooling implementation knows,suppose 20min)it deletes the mgdconnection object without intimating my managed connection.detroy().Then if I call once again javax.resource.cci.ConnectionFactory.getConnection() then jboss connection pool creates new managed connection and works fine.If you delete the mgdconnection object without intimating ManagedConnection.destory(),its not good.How can u close physical connection,just deleting the object from pool??
              I am using MinervaNoTransCMFactory.

              Thanks,
              Ramana