1 Reply Latest reply on Jun 16, 2011 12:45 PM by Steven Bruce

    Get user info from DataSource connection

    Steven Bruce Newbie

      Is it possible to determine which users are using data pool connections?  Or, which subpools are using pool connections?

       

      My JBoss server connects to an Oracle DB, and currently we are maxing out the data pool connections for a specific data source.  Since we are using subpools, the information that I am receiving from the mbean server attributes for the ManagedConnectionPool does not give me an accurate enough picture of what is really happening.  By this I mean that if the max number of connections for DataSource XYZ is 10, I should have 10 connections for both user A and user B.  But if user A has 8 connections and user B has 8 connections, when I retrieve my InUseConnection count from the ManagedConnectionPool, it tells me that I have 16 in use when my max is 10.  Thus, I would like to be able to tell how many I have per subpool so that I have more information to analyze.

       

      Ideally, I would like to be able to see which oracle users are using the connections, however, if the subpools are defined differently than by usernames, it would also be nice if I could see which subpools are using the connections.

      Is this possible?

       

      I'm using JBoss 4.2.3 GA if that helps.

       

      Thanks,

      Steven

        • 1. Re: Get user info from DataSource connection
          Steven Bruce Newbie

          So I've found that I have access to the following classes:

           

          org.jboss.resource.connectionmanager.InternalManagedConnectionPool

          org.jboss.resource.connectionmanager.JBossManagedConnectionPool

           

          org.jboss.resource.connectionmanager.JBossManagedConnectionPool.BasePool

          org.jboss.resource.connectionmanager.JBossManagedConnectionPool.SubPoolContext

          org.jboss.resource.connectionmanager.JBossManagedConnectionPoolMBean

           

           

           

          But I'm not really sure how to use them. 

          I'm currently using the following loop to look at my ManagedConnectionPools, can I access information about the sub pools from what I'm currently doing?

           

           

           

           

           

          ObjectName dbpoolsQryNam = new ObjectName("jboss.jca:service=ManagedConnectionPool,*");
          Object[] dbpools = server.queryNames(dbpoolsQryNam,null).toArray();
          for (int i = 0; i < dbpools.length && status; i++) {
          // code
          }

           

          Thanks,

          Steven