SV: Automatic rollback with Spring for junit tests ? SOLUTION :-)

2006-10-04 Thread erlend.bjorge
Hi!

Just use AbstractTransactionalDatabaseTestCase or whatever it's
called. 

It's not called that, will try to look find it, but do you know the name ?

Sounds more easy to use if it do what I think it does :-)

Thanks!
Erlend


SV: Automatic rollback with Spring for junit tests ? SOLUTION :-)

2006-10-03 Thread erlend.bjorge








Hi there!



I was struggling with this
problem, then I finally realized the problem, ME J



I have been using Hibernate
with Spring (someone else has setup the transactionManager stuff), and when 
I realized what I was actually missing then wola J This line here in the spring-dao.xml file of course J



    bean
id=transactionManager
class=org.springframework.jdbc.datasource.DataSourceTransactionManager

    property
name=dataSource

    ref
bean=dataSource/

    /property

    /bean



But are other better ways
to do it ?



--



Anyway nice Ibatis/Spring
links:



http://www.learntechnology.net/struts-spring-ibatis.do  
(The example I was using, but they didnt have the transactionManager
setup)



Reading this I figured it
all out J



http://www.springframework.org/docs/reference/orm.html#orm-ibatis





Take care,

Erlend