jboss数据源统计信息JMX监视-信息不一致 [英] jboss datasource statistics JMX monitoring - inconsistent information
问题描述
我在jboss 4.2.3(redhat 4.3)的* -ds.xml中定义了两个数据源. 这两个数据源是相同的.仅jndi名称不同 每个定义min = max = 10
I have defined two datasources in *-ds.xml on jboss 4.2.3 (redhat 4.3) Both datasources are identical. Only jndi-name differ Each defines min=max=10
<xa-datasource>
<jndi-name>com.trax.hibernate.DataSource</jndi-name>
<track-connection-by-tx>true</track-connection-by-tx>
<isSameRM-override-value>false</isSameRM-override-value>
<xa-datasource-class>oracle.jdbc.xa.client.OracleXADataSource</xa-datasource-class>
<xa-datasource-property name="URL">jdbc:oracle:thin:@localhost:1521:orcl10</xa-datasource-property>
<xa-datasource-property name="User"> xxxx </xa-datasource-property>
<xa-datasource-property name="Password"> xxxx </xa-datasource-property>
<min-pool-size>10</min-pool-size>
<max-pool-size>10</max-pool-size>
<prefill>true</prefill>
<blocking-timeout-millis>60000</blocking-timeout-millis>
<ih3e-timeout-minutes>15</ih3e-timeout-minutes>
<valid-connection-checker-class-name> org.jboss.resource.adapter.jdbc.vendor.OracleValidConnectionChecker </valid-connection-checker-class-name>
<check-valid-connection-sql>select 1 from gtw_cust</check-valid-connection-sql>
<exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter</exception-sorter-class-name>
<no-tx-separate-pools/>
</xa-datasource>
<xa-datasource>
<jndi-name>AuditTrail.DataSource</jndi-name>
<track-connection-by-tx>true</track-connection-by-tx>
<isSameRM-override-value>false</isSameRM-override-value>
<xa-datasource-class>oracle.jdbc.xa.client.OracleXADataSource</xa-datasource-class>
<xa-datasource-property name="URL">jdbc:oracle:thin:@localhost:1521:orcl10</xa-datasource-property>
<xa-datasource-property name="User">xxxx</xa-datasource-property>
<xa-datasource-property name="Password"> xxxx </xa-datasource-property>
<min-pool-size>10</min-pool-size>
<max-pool-size>10</max-pool-size>
<prefill>true</prefill>
<blocking-timeout-millis>60000</blocking-timeout-millis>
<ih3e-timeout-minutes>15</ih3e-timeout-minutes>
<valid-connection-checker-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleValidConnectionChecker</valid-connection-checker-class-name>
<check-valid-connection-sql>select 1 from gtw_cust</check-valid-connection-sql>
<exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter</exception-sorter-class-name>
<no-tx-separate-pools/>
</xa-datasource>
问题: 在jmx控制台上,name = com.trax.hibernate.DataSource,service = ManagedConnectionPool,该信息显示20个连接,而不是预期的10个.
The problem: On jmx-console, name=com.trax.hibernate.DataSource,service=ManagedConnectionPool, the information shows 20 connections, not 10 as expected.
我希望创建的连接的最大值为10(MaxSize). 似乎实际的连接数是MaxSize的两倍,并且连接已创建和销毁(创建了40个,销毁了20个)
I would expect the max value of created connections to be 10 (MaxSize). Here is seems that the number of actual connection is double MaxSize, and connections were created and destroyed (40 created and 20 destroyed)
我做错了什么?你怎么解释呢?
What am I doing wrong? How can you explain this?
com.trax.hibernate.DataSource:
AvailableConnectionCount 20
ConnectionCount 20
MinSize 10
MaxSize 10
MaxConnectionsInUseCount 11
InUseConnectionCount 0
ConnectionCreatedCount 40
ConnectionDestroyedCount 20
AuditTrail.DataSource:
AvailableConnectionCount 10
ConnectionCount 10
MinSize 10
MaxSize 10
MaxConnectionsInUseCount 8
InUseConnectionCount 0
ConnectionCreatedCount 20
ConnectionDestroyedCount 10
推荐答案
这是由于属性<no-tx-separate-pools/>
所致.请参阅《 JBoss Server配置指南》中有关XA数据源的文档:
That's because of the property <no-tx-separate-pools/>
. See the documentation for XA Data Sources, in JBoss Server Configuration Guide:
<no-tx-separate-pools>
分别合并事务和非事务连接
Pool transactional and non-transactinal connections separately
警告
使用此选项将导致您的总池大小是max-pool-size的两倍,因为将创建两个实际的池.
Using this option will cause your total pool size to be twice max-pool-size, because two actual pools will be created.
这篇关于jboss数据源统计信息JMX监视-信息不一致的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!