ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Brian Parkinson" <pa...@avaning.com>
Subject RE: Spring with IBatis and Transaction Manager Helps.
Date Fri, 22 Aug 2008 11:36:15 GMT
Hi Bala:
I am using Spring with iBatis with transations. Below is the config that
I am using - note the use of the spring tx:* AOP transaction injection.
There are docs in the spring project related to how to set this up (mine
below is pretty much a copy of that example).
Hope it helps.
Brian Parkinson.
--- x8 snip
SqlMapConfig contains:
 <transactionManager type="EXTERNAL">
  <dataSource type="DBCP">
Spring transactions:
 <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"
Spring datasource:
 <bean id="mapConfig"
 <bean id="dataSource"
  <property name="targetDataSource">
   <ref local="dataSourceImpl"/>
 <bean id="dataSourceImpl"
class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
  <property name="driverClassName" value="com.mysql.jdbc.Driver" />
  <property name="url" value="jdbc:mysql:///ecobee" />
  <property name="username" value="XXX" />
  <property name="password" value="YYY" /> 
  <property name="initialSize" value="10" />
  <property name="maxActive" value="100" /> 
  <property name="maxIdle" value="16" />
  <property name="maxWait" value="2000" />
 <bean id="sqlMapClient"
  <property name="dataSource" ref="dataSource" />
  <property name="configLocation" ref="mapConfig" />


From: bala r [mailto:balar4u@gmail.com] 
Sent: Thursday, August 21, 2008 4:10 PM
To: user-java@ibatis.apache.org
Subject: Spring with IBatis and Transaction Manager Helps.


I have to implement TransacationManager in my module using Spring with

Here is my requirments.

TransacationProcessor  - 
  --Open Transacation
  --Call LoopProcessor(process multiple files )
           --- Call DatabaseProcessor
                      -- Call SQLMqpClient Insert/update/delete.
           -- Call OtherProcessor do Work.
  --All Success then Committransaction.
  -- If fails rollbackTransacation.
  --End Transaction.

Any documents for handling Spring and Ibaris or any examples i can get
from any source? 
I tried google Spring with Ibatis transaction but couldnt find any much


View raw message