Transaction does not roll back when using Spring 3 @Transactional annotation?

Transactional is applied to the Spring-managed beans only (unless you have configured advanced features), whereas in your case FormatDaoTest isn't managed by Spring I guess you can do the following as a quick fix: public static void main(String args) { FormatDaoTest test = context. GetAutowireCapableBeanFactory() . CreateBean(FormatDaoTest.

Class); test.doTransaction(); } As a more elegant solution you can use Spring TestContext framework, which supports transaction-aware tests out of the box, see 9.3.5.4 Transaction management.

Transactional is applied to the Spring-managed beans only (unless you have configured advanced features), whereas in your case FormatDaoTest isn't managed by Spring. I guess you can do the following as a quick fix: public static void main(String args) { FormatDaoTest test = context. GetAutowireCapableBeanFactory() .

CreateBean(FormatDaoTest. Class); test.doTransaction(); } As a more elegant solution you can use Spring TestContext framework, which supports transaction-aware tests out of the box, see 9.3.5.4 Transaction management.

Grr, exactly what I would've written :-) (+1) – Sean Patrick Floyd Mar 18 at 12:05 Thanks very much! Had to be something as obvious as that really. – user665909 Mar 18 at 12:07 Had to then download 'cglib_2.2.Jar' and add to my classpath to get this to work.

I would have thought SPRING FRAMEWORK 3.1 M1 would have included all of the dependent classes however? There seems to be a theme whereby I need to download other dependent jars to overcome errors I hit! – user665909 Mar 18 at 12:56 @user665909: Spring has many features that are not used by all users, therefore dependenies required by these fatures are optional and not shipped with Spring, though sometimes it can be annoying.

– axtavt Mar 18 at 14:44.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions