4 Replies Latest reply on Oct 18, 2006 2:29 AM by kazam

    Connection in Use Keeps going Up Jboss 4.0.4.GA Jboss 4.0.4c

    kazam Newbie

      I am running my application on Jboss 4.0.4.GA and Jboss 4.0.4.c and on both of them on the ManagedConnectionPool MBEAN

      ConnectionCreatedCount (Keep going up)
      ConnectionDestroyedCount (Keep going up )
      InUseConnectionCount (Only goes up until managed connection error is thrown and application crashes).

      Other Information
      ----------------------
      - Log file:
      I see no entry for any connection leak or house keeping message.
      I can't see any message related to IDLE REMOVERrunning.

      - I am retrieving the connection using getConnection() only, no user/passwd. This was working fine on jboss-4.0.2 but not since then.

      - I have two hibernate applications running on this jboss which use same database but are running fine and aren't using JNDI pooling.

      Oracle-ds.xml file
      -------------------------

      <?xml version="1.0" encoding="UTF-8"?>
      <datasources>
       <local-tx-datasource>
       <jndi-name>jdbc/oracle</jndi-name>
       <connection-url>jdbc:oracle:thin:@localhost:1521:proddb</connection-url>
       <driver-class>oracle.jdbc.driver.OracleDriver</driver-class>
       <user-name>user</user-name>
       <password>pass</password>
       <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter</exception-sorter-class-name>
       <min-pool-size>20</min-pool-size>
       <max-pool-size>150</max-pool-size>
       <idle-timeout-minutes>1</idle-timeout-minutes>
       <blocking-timeout-millis>7000</blocking-timeout-millis>
       <!-- sql to call when connection is created
       <new-connection-sql>some arbitrary sql</new-connection-sql>
       -->
       <!-- sql to call on an existing pooled connection when it is obtained from pool - the OracleValidConnectionChecker is prefered
       <check-valid-connection-sql>some arbitrary sql</check-valid-connection-sql>
       -->
       <!-- corresponding type-mapping in the standardjbosscmp-jdbc.xml (optional) -->
       <metadata>
       <type-mapping>Oracle9i</type-mapping>
       </metadata>
       </local-tx-datasource>
      
      </datasources>
      


      Please, any ideas are welcome. I am confused as to why the idle remover is not running and why are the inUseConnections not coming down even when no one is connected to the application for hours.

      Thanks,Kazam.

        • 1. Re: Connection in Use Keeps going Up Jboss 4.0.4.GA Jboss 4.
          kazam Newbie

          Forgot to mention that I have my jboss-jca configured as follows

           <!--
           | The CachedConnectionManager is used partly to relay started UserTransactions to
           | open connections so they may be enrolled in the new tx.
           -->
           <mbean code="org.jboss.resource.connectionmanager.CachedConnectionManager"
           name="jboss.jca:service=CachedConnectionManager">
           <depends optional-attribute-name="TransactionManagerServiceName">jboss:service=TransactionManager</depends>
          
           <!-- Enable connection close debug monitoring -->
           <attribute name="Debug">true</attribute>
          


          I am getting these messages on startup however, they are not impacting my application. In some of these messages I see

          jboss.jca:service=DataSourceBinding,name=DefaultDS
          However, my oracle-ds.xml has datasource as jdbc/oracle, but I think I don't need the mentioned services.

          Can these be related to the malfunction of jca?

          --- MBeans waiting for other MBeans ---
          ObjectName: jboss.ws:service=DeployerInterceptorEJB3
           State: CONFIGURED
           I Depend On:
           jboss.ejb3:service=EJB3Deployer
          
          ObjectName: jboss.mq:service=InvocationLayer,type=HTTP
           State: CONFIGURED
           I Depend On:
           jboss.mq:service=Invoker
           jboss.web:service=WebServer
          
          ObjectName: jboss:service=KeyGeneratorFactory,type=HiLo
           State: CONFIGURED
           I Depend On:
           jboss:service=TransactionManager
           jboss.jca:service=DataSourceBinding,name=DefaultDS
          
          ObjectName: jboss.mq:service=StateManager
           State: CONFIGURED
           I Depend On:
           jboss.jca:service=DataSourceBinding,name=DefaultDS
           Depends On Me:
           jboss.mq:service=DestinationManager
          
          ObjectName: jboss.mq:service=DestinationManager
           State: CONFIGURED
           I Depend On:
           jboss.mq:service=MessageCache
           jboss.mq:service=PersistenceManager
           jboss.mq:service=StateManager
           jboss.mq:service=ThreadPool
           jboss:service=Naming
           Depends On Me:
           jboss.mq.destination:service=Topic,name=testTopic
           jboss.mq.destination:service=Topic,name=securedTopic
           jboss.mq.destination:service=Topic,name=testDurableTopic
           jboss.mq.destination:service=Queue,name=testQueue
           jboss.mq.destination:service=Queue,name=A
           jboss.mq.destination:service=Queue,name=B
           jboss.mq.destination:service=Queue,name=C
           jboss.mq.destination:service=Queue,name=D
           jboss.mq.destination:service=Queue,name=ex
           jboss.mq:service=SecurityManager
           jboss.mq.destination:service=Queue,name=DLQ
          
          ObjectName: jboss.mq:service=PersistenceManager
           State: CONFIGURED
           I Depend On:
           jboss.jca:service=DataSourceBinding,name=DefaultDS
           Depends On Me:
           jboss.mq:service=DestinationManager
          
          ObjectName: jboss.mq.destination:service=Topic,name=testTopic
           State: CONFIGURED
           I Depend On:
           jboss.mq:service=DestinationManager
           jboss.mq:service=SecurityManager
          
          ObjectName: jboss.mq.destination:service=Topic,name=securedTopic
           State: CONFIGURED
           I Depend On:
           jboss.mq:service=DestinationManager
           jboss.mq:service=SecurityManager
          
          ObjectName: jboss.mq.destination:service=Topic,name=testDurableTopic
           State: CONFIGURED
           I Depend On:
           jboss.mq:service=DestinationManager
           jboss.mq:service=SecurityManager
          
          ObjectName: jboss.mq.destination:service=Queue,name=testQueue
           State: CONFIGURED
           I Depend On:
           jboss.mq:service=DestinationManager
           jboss.mq:service=SecurityManager
          
          ObjectName: jboss.mq.destination:service=Queue,name=A
           State: CONFIGURED
           I Depend On:
           jboss.mq:service=DestinationManager
          
          ObjectName: jboss.mq.destination:service=Queue,name=B
           State: CONFIGURED
           I Depend On:
           jboss.mq:service=DestinationManager
          
          ObjectName: jboss.mq.destination:service=Queue,name=C
           State: CONFIGURED
           I Depend On:
           jboss.mq:service=DestinationManager
          
          ObjectName: jboss.mq.destination:service=Queue,name=D
           State: CONFIGURED
           I Depend On:
           jboss.mq:service=DestinationManager
          
          ObjectName: jboss.mq.destination:service=Queue,name=ex
           State: CONFIGURED
           I Depend On:
           jboss.mq:service=DestinationManager
          
          ObjectName: jboss.mq:service=Invoker
           State: CONFIGURED
           I Depend On:
           jboss.mq:service=TracingInterceptor
           jboss:service=Naming
           Depends On Me:
           jboss.mq:service=InvocationLayer,type=HTTP
           jboss.mq:service=InvocationLayer,type=JVM
           jboss.mq:service=InvocationLayer,type=UIL2
          
          ObjectName: jboss.mq:service=TracingInterceptor
           State: CONFIGURED
           I Depend On:
           jboss.mq:service=SecurityManager
           Depends On Me:
           jboss.mq:service=Invoker
          
          ObjectName: jboss.mq:service=SecurityManager
           State: CONFIGURED
           I Depend On:
           jboss.mq:service=DestinationManager
           Depends On Me:
           jboss.mq.destination:service=Topic,name=testTopic
           jboss.mq.destination:service=Topic,name=securedTopic
           jboss.mq.destination:service=Topic,name=testDurableTopic
           jboss.mq.destination:service=Queue,name=testQueue
           jboss.mq:service=TracingInterceptor
           jboss.mq.destination:service=Queue,name=DLQ
          
          ObjectName: jboss.mq.destination:service=Queue,name=DLQ
           State: CONFIGURED
           I Depend On:
           jboss.mq:service=DestinationManager
           jboss.mq:service=SecurityManager
          
          ObjectName: jboss.mq:service=InvocationLayer,type=JVM
           State: CONFIGURED
           I Depend On:
           jboss.mq:service=Invoker
          
          ObjectName: jboss.mq:service=InvocationLayer,type=UIL2
           State: CONFIGURED
           I Depend On:
           jboss.mq:service=Invoker
          
          --- MBEANS THAT ARE THE ROOT CAUSE OF THE PROBLEM ---
          ObjectName: jboss.jca:service=DataSourceBinding,name=DefaultDS
           State: NOTYETINSTALLED
           Depends On Me:
           jboss:service=KeyGeneratorFactory,type=HiLo
           jboss.mq:service=StateManager
           jboss.mq:service=PersistenceManager
          
          ObjectName: jboss.ejb3:service=EJB3Deployer
           State: NOTYETINSTALLED
           Depends On Me:
           jboss.ws:service=DeployerInterceptorEJB3
          
          


          Thanks, kazam.

          • 2. Re: Connection in Use Keeps going Up Jboss 4.0.4.GA Jboss 4.
            kazam Newbie

            More Information
            ------------------------

            Looking at the forum, I think I am missing this piece of information.

            This is how I am retrieving my connections

            protected Connection retrieveConnection()
             {
             DataSource oradbConnection;
            
             try
             {
             //Get DataSource from JNDI repository in JBoss 4.0.2
             Context jndiContext= new InitialContext();
             oradbConnection=(DataSource)jndiContext.lookup("java:jdbc/oracle");
             return oradbConnection.getConnection();
            
             }
             catch(NamingException e)
             {
             throw new RuntimeException("NamingException: Failed to retrieve initial naming Context through JNDI : "+ e.getMessage(),e);
             }
             catch(SQLException e)
             {
             throw new RuntimeException("SQLException: Failed to retrieve DB connection from JNDI connection pool : "+e.getMessage(),e);
             }
             }
            


            All connections are being closed in finally block.

            Please look at the previous 2 posts for problem description and information.
            Thanks, kazam.

            • 3. Re: Connection in Use Keeps going Up Jboss 4.0.4.GA Jboss 4.
              Weston Price Newbie

              I have no idea what you are talking about when you say 4.0.4c, there has never been such a release, there is no corresponding tag, and I am not sure what you are talking about.

              The deployment issues you are seeing suggest that the Default datasource cannot be deployed and as a result, JMS cannot be deployed either. JMS depends on JDBC for message persistence. This is not a trivial error and generally suggests something is wrong with your JBoss installation. Did you modify the DefaultDS in any way?

              My next question would be where does retrieveConnection occur? Servlet, EJB? By default you will not get connection close behavior (or logging) in a Serlvet, it has to be specifically enabled. For EJB's the ConnectionCacheInterceptor performs this task.

              Have you enabled TRACE in your log4j.xml configuration?


              ' I have two hibernate applications running on this jboss which use same database but are running fine and aren't using JNDI pooling.


              What does this mean? There is no such thing as 'JNDI pooling'.




              • 4. Re: Connection in Use Keeps going Up Jboss 4.0.4.GA Jboss 4.
                kazam Newbie

                Thanks very much,
                4.0.4c was a jboss version I got when I installed jbpm, it was part of the starters kit, I was not aware that it was not a release or tag.

                However, it is the same behaviour on the JBOSS 4.0.4 GA.

                RetrieveConnection() is being used in servlets, so I will turn it on for servlets and also turn trace onb in log4j.xml.

                Also, you are correct it is not JNDI Pooling, I meant the JCA Connection pool.

                Thanks very much for the help.
                Kazam.