Atomikos Forum |
|
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
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 |