Here is my configuration, it is pretty much straight from the documentation.
I have constrained the connection pool in this instance to only just 2 to
cause the problem to occur more quickly in testing.
<!-- - - - - - - - - - - -->
<!-- Transaction Manager -->
<!-- - - - - - - - - - - -->
<bean id="transactionContextManager"
class="org.jencks.factory.TransactionContextManagerFactoryBean"/>
<bean id="userTransaction"
class="org.jencks.factory.GeronimoTransactionManagerFactoryBean"/>
<bean id="transactionManager"
class="org.springframework.transaction.jta.JtaTransactionManager">
<property name="userTransaction"><ref
local="userTransaction"/></property>
</bean>
<!-- - - - - - - - - - - - -->
<!-- JMS connection factory -->
<!-- - - - - - - - - - - - -->
<bean id="jmsTransactionSupport"
class="org.jencks.factory.XATransactionFactoryBean">
<property name="useTransactionCaching" value="true"/>
<property name="useThreadCaching" value="false"/>
</bean>
<bean id="jmsPoolingSupport"
class="org.jencks.factory.SinglePoolFactoryBean">
<property name="maxSize" value="20"/>
<property name="minSize" value="1"/>
<property name="blockingTimeoutMilliseconds" value="60"/>
<property name="idleTimeoutMinutes" value="2"/>
<property name="matchOne" value="true"/>
<property name="matchAll" value="true"/>
<property name="selectOneAssumeMatch" value="true"/>
</bean>
<bean id="jmsConnectionManager"
class="org.jencks.factory.ConnectionManagerFactoryBean">
<property name="transactionSupport"><ref
local="jmsTransactionSupport"/></property>
<property name="poolingSupport"><ref
local="jmsPoolingSupport"/></property>
</bean>
<bean id="jmsResourceAdapter"
class="org.apache.activemq.ra.ActiveMQResourceAdapter">
<property name="serverUrl" value="${jms.serverUrl}"/>
</bean>
<bean id="jmsManagedConnectionFactory"
class="org.apache.activemq.ra.ActiveMQManagedConnectionFactory">
<property name="resourceAdapter"><ref
local="jmsResourceAdapter"/></property>
</bean>
<bean id="connectionFactory"
class="org.springframework.jca.support.LocalConnectionFactoryBean">
<property name="managedConnectionFactory"><ref
local="jmsManagedConnectionFactory"/></property>
<property name="connectionManager"><ref
local="jmsConnectionManager"/></property>
</bean>
<!-- - - - - - - - - -->
<!-- JDBC Datasource -->
<!-- - - - - - - - - -->
<bean id="dbTransactionSupport"
class="org.jencks.factory.XATransactionFactoryBean">
<property name="useTransactionCaching" value="true"/>
<property name="useThreadCaching" value="false"/>
</bean>
<bean id="dbPoolingSupport"
class="org.jencks.factory.SinglePoolFactoryBean">
<property name="maxSize" value="2"/>
<property name="minSize" value="1"/>
<property name="blockingTimeoutMilliseconds" value="60"/>
<property name="idleTimeoutMinutes" value="1"/>
<property name="matchOne" value="true"/>
<property name="matchAll" value="true"/>
<property name="selectOneAssumeMatch" value="true"/>
</bean>
<bean id="dbConnectionManager"
class="org.jencks.factory.ConnectionManagerFactoryBean">
<property name="transactionSupport"><ref
local="dbTransactionSupport"/></property>
<property name="poolingSupport"><ref
local="dbPoolingSupport"/></property>
</bean>
<bean id="dbManagedConnectionFactory"
class="org.jencks.tranql.XAPoolDataSourceMCF">
<property name="driverName" value="${jdbc.driver}"/>
<property name="url" value="${jdbc.url}"/>
<property name="user" value="${jdbc.username}"/>
<property name="password" value="${jdbc.password}"/>
</bean>
<bean id="dataSource"
class="org.springframework.jca.support.LocalConnectionFactoryBean">
<property name="managedConnectionFactory"><ref
local="dbManagedConnectionFactory"/></property>
<property name="connectionManager"><ref
local="dbConnectionManager"/></property>
</bean>
--
View this message in context:
http://www.nabble.com/JDBC-XA%2C-SinglePoolFactoryBean-and-idle-connections.-t1382502.html#a3712515
Sent from the jencks - user forum at Nabble.com.