ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Brian Parkinson" <pa...@avaning.com>
Subject Question(s) about DAO setup - possible Throttle deadlock?
Date Tue, 05 Aug 2008 23:32:02 GMT
Hoping someone can help - I am running into what appears to be a
deadlock issue, and starting to investigate, but I thought I'd pop a
question or two out to see if anyone can help.
1. Is it bad practice for a Dao implementation to call another? I use
Spring to set everything up (see below). In one Dao object which
controls the Foo table, I also want to update the Bar table, so I am
public class FooDao extends SqlMapClientDaoSupport implements IFooDao
  final private static IBarDao BAR_DAO = (IBarDao)
This way, in my save and update method, I can call to the BAR_DAO to
update that table.
Is this bad? Any hints on best practices here appreciated.
2. As noted above, I have seen some deadlock (and hence wondering
whether question #1 might be related) - when I looked at blocked
threads, I noted some references to the iBATIS Throttle object, and have
seen some articles related to this. I am using iBATIS verison
- should I upgrade?
3. My config set up is below - this seems to be all correct but
wondering if I've missed anything, or have anything set up obviously
Any help is appreciated - regards,
Brian Parkinson
Avaning Inc.
--- x8 snip
 <bean id="txManager"
  <property name="dataSource" ref="dataSource"/>
 <tx:advice id="txAdvice" transaction-manager="txManager">
   <tx:method name="get*" read-only="true" />
   <tx:method name="*" />
  <aop:pointcut id="daoServiceOperation" expression="execution(*
com.ecobee.foundation.dao.ibatis.*.*(..))" />
  <aop:advisor advice-ref="txAdvice" pointcut-ref="daoServiceOperation"
 <bean id="mapConfig"
 <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"
  <property name="driverClassName" value="com.mysql.jdbc.Driver" />
  <property name="url" value="jdbc:mysql:///ecobee" />
  <property name="username" value="XXX" />
  <property name="password" value="XXX" /> 
  <property name="initialSize" value="10" />
  <property name="maxActive" value="100" /> 
  <property name="maxIdle" value="10" />
 <bean id="sqlMapClient"
  <property name="dataSource" ref="dataSource" />
  <property name="configLocation" ref="mapConfig" />
 <bean id="fooDao" class="com.ecobee.foundation.dao.ibatis.FooDao">
  <property name="sqlMapClient" ref="sqlMapClient" />
 <bean id="barDao" class="com.ecobee.foundation.dao.ibatis.BarDao">
  <property name="sqlMapClient" ref="sqlMapClient" />

View raw message