Atomikos Forum

Monitoring Connection Pool

We are migrating from Websphere to Tomcat7 and there was a need for XA, hence we decided to try Atomikos Transaction Essentials.
I have configured Atomikos Transaction Essentials and it works.
Bu the other day, I was trying to find way to monitor the connection pool of Atomikos and came across below link:

default82df.html?community.6.1103.3

I too exposed a jmx bean to see the current available connections and total pool size as below:

public class JmxAtomikosConnectionPoolMonitoringServiceImpl implements JmxAtomikosConnectionPoolMonitoringService {
    public static final Logger LOGGER = Logger.getLogger(JmxAtomikosConnectionPoolMonitoringServiceImpl.class);

    private AtomikosDataSourceBean atomikosDataSourceBean;

    @Override
    public int getPoolAvailableSize() {
        int poolAvailableSize = atomikosDataSourceBean.poolAvailableSize();
        LOGGER.debug("PoolAvailableSize: " + poolAvailableSize);
        return poolAvailableSize;
    }

    @Override
    public int getPoolTotalSize() {
        int poolTotalSize = atomikosDataSourceBean.poolTotalSize();
        LOGGER.debug("PoolTotalSize: " + poolTotalSize);
        return poolTotalSize;
    }

    public void setAtomikosDataSourceBean(AtomikosDataSourceBean atomikosDataSourceBean) {
        this.atomikosDataSourceBean = atomikosDataSourceBean;
    }
}

Configuration:

<!-- Configure the Atomikos JMX transaction service to administer pending transactions -->
    <bean id="jmxTransactionService" class="com.atomikos.icatch.admin.jmx.JmxTransactionService">
        <!-- Optional: show only heuristic problem cases -->
        <property name="heuristicsOnly" value="true"/>
    </bean>
    
    <!-- Spring JMX config -->
    <bean id="mbeanServer" class="org.springframework.jmx.support.MBeanServerFactoryBean">
      <property name="locateExistingServerIfPossible" value="true"/>
    </bean>
    
    <!-- Export the Atomikos JMX transaction service to the local JMX service in the running VM (1.5 or higher) -->
    <bean id="exporter" class="org.springframework.jmx.export.MBeanExporter">
            <property name="beans">
                <map>
                    <entry key="atomikos:name=tx-service">
                        <ref bean="jmxTransactionService"/>
                    </entry>
                    <entry key="connectionpool:name=tx-connectionpool">
                        <ref bean="jmxAtomikosConnectionPoolMonitoringService"/>
                    </entry> 
                </map>
            </property>
            <property name="server">
                <ref bean="mbeanServer"/>
            </property>
    </bean>
    
    <!-- Connection Pool JMX Service -->
    <bean id="jmxAtomikosConnectionPoolMonitoringService" class="com.klm.epass.jmx.JmxAtomikosConnectionPoolMonitoringServiceImpl">
      <property name="atomikosDataSourceBean" ref="oracleXADatasource"/>
    </bean>

<bean id="oracleXADatasource" class="com.atomikos.jdbc.AtomikosDataSourceBean" init-method="init" destroy-method="close">
        <property name="xaDataSource" ref="dataSource"/>
        <property name="uniqueResourceName" value="oraclexa" /> 
        <property name="minPoolSize" value="1" />
        <property name="maxPoolSize" value="4" /> 
        <property name="maxLifetime" value="120" />
        <!-- <property name="testQuery" value="select 1 from dual" /> -->
        <property name="xaProperties">
        <!-- set the driver-specific XADataSource properties (check your driver docs for more info) -->
            <props>           
                <prop key="connectionCachingEnabled">false</prop>
                <prop key="implicitCachingEnabled">false</prop>
                <!-- <prop key="connectionCacheProperties">InactivityTimeout=1800,PropertyCheckInterval=300,MaxStatementsLimit=125,ValidateConnection=true</prop> -->
            </props>
        </property>
        <!-- how many connections in the pool? -->
      <!-- <property name="poolSize" value="4"/> -->
    </bean>

But whenever I connect using jconsole and hit a soapui request in loop continuously on a transaction in single database, the connection pool never changes and always show poolAvailableSize as 1 and poolTotalSize as 1.

Why the current pool size never changes?
Saif Ahmad Siddiqui Send private email
Monday, June 30, 2014
 
 
Hi,

Our commercial subscription includes support and working JMX controls. It is worth every single Euro, the prices have been determined in close collaboration with our existing customers.

http://www.atomikos.com/Main/BuyOnline

Thanks
Guy Pardon Send private email
Monday, June 30, 2014
 
 
Hi,

First, we want to verify if its working as per our expectations.
Once we are satisfied, we will consider it.

Regards,
Saif
Saif Ahmad Siddiqui Send private email
Tuesday, July 01, 2014
 
 

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics