6 Replies Latest reply on Jul 4, 2018 7:40 PM by 中島佑樹 中島佑樹

    How to check the connection pool with JMX ?(TransactionalDataSourceFactory)

    中島佑樹 中島佑樹 Newbie

      English I forgive but I'm poor.

       

      We have developed web application server for enterprise with your org.jboss.narayana.tomcat.jta.TransactionalDataSourceFactory.

      We have watcher service to JMX.

      So, we want to check the connection pool with JMX (like org.apach.tomcat.jdbc.pool.jmx.ConnectionPoolMBean).

      • getIdle()
      • getSize()
      • getActive()
      • getNumIdle()
      • getNumActibe()
      • getWaitCount()

       

      But, we can't find it on JMX.

       

      Please tell me how to check the connection pool with JMX .

       

       

      Information details are as follows:

       

      The following resources are found on JMX.

       

      But, they have only the following JMX info.

      jmx-console

       

      Specification

      Tomcat 9.0.8

      pom.xml

              <dependency>

                  <groupId>org.jboss.narayana.tomcat</groupId>

                  <artifactId>tomcat-jta</artifactId>

                  <version>5.8.2.Final</version>

                  <exclusions>

                      <exclusion>

                          <groupId>*</groupId>

                          <artifactId>*</artifactId>

                      </exclusion>

                  </exclusions>

              </dependency>

       

      context.xml is put on "webapp/contextpath/META-INF/context.xml".

          <Transaction factory="org.jboss.narayana.tomcat.jta.UserTransactionFactory" />
          
          <Resource
              factory="org.jboss.narayana.tomcat.jta.TransactionManagerFactory"
              name="TransactionManager"
              type="javax.transaction.TransactionManager"/>
                  
          <Resource
              factory="org.jboss.narayana.tomcat.jta.TransactionSynchronizationRegistryFactory"
              name="TransactionSynchronizationRegistry"
              type="javax.transaction.TransactionSynchronizationRegistry" />
                  
          <Resource
              name="postgresDS"
              uniqueName="myDataSource"
              auth="Container"
              type="org.postgresql.xa.PGXADataSource"
              factory="org.postgresql.xa.PGXADataSourceFactory"
              databaseName="@AURORA_DATABASE_NAME@"
              jmxEnabled="true"
              user="@AURORA_USER@"
              password="@AURORA_PASSWORD@"
              portNumber="@AURORA_PORT@"
              serverName="@AURORA_SERVER_NAME@"/>
      
      
          <Resource
              name="transactionalDataSource"
              uniqueName="transactionalDataSource"
              auth="Container"
              xaDataSource="postgresDS"
              type="javax.sql.XADataSource"
              factory="org.jboss.narayana.tomcat.jta.TransactionalDataSourceFactory"
              transactionManager="TransactionManager"
              driverClassName="com.arjuna.ats.jdbc.TransactionalDriver"
              username="@AURORA_USER@"
              initialSize="@AURORA_INITIAL_SIZE@"
              minIdle="@AURORA_MIN_IDLE@"
              maxActive="@AURORA_MAX_ACTIVE@"
              jmxEnabled="true"
              validationQuery="SELECT 1"
              validationInterval="10000"/>
      

       

      We already checked that the connection pool is enabled.

      (We changed the parameter of connection pool then checked the number of connections.)

       

      Thanks.