Atomikos Forum

Monitoring connection pool setup with atomikos.

Hi,

I am using atomikos transaction essentials along with spring.

Our datasource configuration appears like

    <bean id="dataSource"
        class="com.atomikos.jdbc.AtomikosDataSourceBean"
        destroy-method="shutdown">
        <property name="xaDataSourceClassName">
            <value>${jdbc.driverClassName}</value>
        </property>
        <property name="uniqueResourceName">
            <value>AGLTDS</value>
        </property>
        <property name="xaProperties">
            <props>
                <prop key="user">${jdbc.username}</prop>
                <prop key="password">${jdbc.password}</prop>
                <prop key="URL">
                    ${jdbc.url}
                </prop>
            </props>
        </property>
        <property name="minPoolSize"><value>1</value></property>
        <property name="maxPoolSize"><value>10</value></property>        
    </bean>

I am going to add some monitoring capabilities for connection pool. Here I am planning to use JMX beans. I wanted to know if there is any way to get the handle to the connection pool created by Atomikos and provide the statistics for monitoring.

Thanks,
Shashi
Shashikant Kale Send private email
Friday, November 27, 2009
 
 
Hi,

The pool is available via the datasource (AbstractDataSourceBean class). It is currently a private transient attribute.

Best
Guy Pardon Send private email
Friday, November 27, 2009
 
 
Thanks Guy!

I checked the AbstractDataSourceBean and found that there are apis like poolTotalSize and poolAvailableSize to know the current configuration of the pool.

I exposed the mbean around these apis to provide monitoring capabilities. However I observed that the connection pool is initialized in a lazy way and is null if datasource is not accessed earlier. Hence I get NPE when I invoke the apis before using the datasource. If I use the pool before using the apis then I get correct results back.

Is there a way to initialize the pool in an eager way?

Thanks for your help,
Shashi
Shashikant Kale Send private email
Monday, November 30, 2009
 
 
You can init the pool by calling init on the datasource?
Guy Pardon Send private email
Tuesday, December 01, 2009
 
 

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

Other recent topics Other recent topics