Back Forum Reply New

How to config spring with Ibatis transaction

Dear,

I am using Spring + Ibatis,  I know how to using calling sql in sqlMap using ibatis.  However,  I want to do automatic transaction for update.  Since I can do that with hibernate before.  Anyone do that before?

For example, in service layer in Spring, update the Person info without calling update method in DAO.public void updatePerson(){
Person p = accountService.findPerson(2);
p.setFirstName(quot;helloworldquot;);
}In applicationContext.xml,

lt;bean id=quot;peopleServicequot;
class=quot;com.service.PeopleServiceImplquot;gt;
lt;/beangt;

lt;aop:configgt;
lt;aopointcut id=quot;peopleServiceMethodsquot;
expression=quot;execution(* com.service.PeopleService.*(..))quot; /gt;
lt;aop:advisor advice-ref=quot;ibatisTransactionManagerAdvicequot;
pointcut-ref=quot;peopleServiceMethodsquot; /gt;
lt;/aop:configgt;

I have already defined ibatisTransactionManagerAdvice
Thanks a lot

Brenda

this question is out of place
but you are related with DAO and AOP, transaction topics , mmm

However, I want to do automatic transaction for update.

why you think that it is not automatic?

i suggest you must ask or make your post in Data Access section

here is not the correct place
¥
Back Forum Reply New