|
From: lak_dev2020 <lak...@li...> - 2009-08-07 08:51:35
|
I am using Spring Transaction + JBOss JTA(XADatasource) +DBCP+ Spring DAO +
iBatis SQL map. After a query is executed the connection is not returning
back to the pool. I debugged the open source code
In DBCP, GenericObjectPool.addObjectToPool is calling
connection.rollback(), which calls
if(com.arjuna.ats.jta.TransactionManager.transactionManager().getTransaction()
!= null)
throws an exception.
Due to the above exception it is not returning the connection to the pool.
I have tried various options including setting commitRequired flag in
iBatis, but the connection is not returning to the pool and not closing
also.
Here is the configuration, I am using:
ibatis sqlMapConfig.xml:
<transactionManager type="JTA" commitRequired="true">
<dataSource type="DBCP">
</dataSource>
</transactionManager>
DBCP:
<bean id="devSqlMapConfig"
class="org.springframework.orm.ibatis.SqlMapClientFactoryBean">
<property name="configLocation">
<value>classpath:com/core/sqlMapConfig.xml</value>
</property>
<property name="dataSource" ref="mydb" />
</bean>
<bean id="mydb"
class="org.apache.commons.dbcp.BasicDataSource">
<!-- all conn properties set here -->
</bean>
transaction boundary:
<tx:method name="*" propagation="REQUIRED" isolation="DEFAULT"
timeout="5000" read-only="false" />
<bean id="jbossTransactionManager"
class="com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionManagerImple">
</bean>
<bean id="txnManager"
class="org.springframework.transaction.jta.JtaTransactionManager">
<property name="transactionManager">
<ref bean="jbossTransactionManager" />
</property>
<property name="autodetectUserTransaction" value="false"/>
</bean>
--
View this message in context: http://www.nabble.com/Connection-leak-with-iBatis-queries-using-Spring-Transaction-%2B-JBOss-JTA-%2B-Spring-DAO-%2B-iBatis-SQL-map-tp24861170p24861170.html
Sent from the springframework-developer mailing list archive at Nabble.com.
|