WAS v8.5 > Reference > Developer best practicesConnection and connection pool statistics
WebSphere Application Server supports use of PMI APIs to monitor the performance of data access applications.
PMI method calls that are supported in the two existing Connection Managers (JDBC and J2C) are supported in this version of WAS. The calls include:
- ManagedConnectionsCreated
- ManagedConnectionsAllocated
- ManagedConnectionFreed
- ManagedConnectionDestroyed
- BeginWaitForConnection
- EndWaitForConnection
- ConnectionFaults
- Average number of ManagedConnections in the pool
- Percentage of the time the connection pool is using the maximum number of ManagedConnections
- Average number of threads waiting for a ManagedConnection
- Average percent of the pool in use
- Average time spent waiting on a request
- Number of ManagedConnections that are in use
- Number of Connection Handles
- FreePoolSize
- UseTime
Java Specification Request (JSR) 77 requires statistical data to be accessed through managed beans (Mbeans) to facilitate this. The Connection Manager passes the ObjectNames of the Mbeans created for this pool. In the case of JMS null is passed in. The interface used is:
PmiFactory.createJ2CPerf( String pmiName, // a unique Identifier for JCA /JDBC. This is the // ConnectionFactory name. ObjectName providerName, // the ObjectName of the J2CResourceAdapter // or JDBCProvider Mbean ObjectName factoryName // the ObjectName of the J2CConnectionFactory // or DataSourceMbean. )The following Unified Modeling Language (UML) diagram shows how JSR 77 requires statistics to be reported:
Figure 1.
JCAConnectionPoolStats and JDBCConnectionPoolStats objects do not have a direct implementing Mbean; the statistics are gathered through a call to PMI. A J2C resource adapter, and JDBC provider each contain a list of ConnectionFactory or DataSource ObjectNames, respectively. The ObjectNames are used by PMI to find the appropriate connection pool in the list of PMI modules.
The JCA 1.5 Specification allows an exception from the matchManagedConnection() method that indicates the resource adapter requests the connection not be pooled. In that case, statistics for that connection are provided separately from the statistics for the connection pool.
Related concepts:
Connection pooling