Bill Gorder wrote:My first suggestion to you if you are learning Spring is going to be use the modern controllers. Your controllers should not need to implement any Spring interfaces or extend any Spring classes (like SimpleFormController etc). I would first recommend you to update your Spring to the latest version and rework your projects controllers with the modern @Controller style.
You can see some examples of this here:
http://krams915.blogspot.com/2010/12/spring-3-mvc-using-modelattribute-in.html
https://github.com/SpringSource/spring-mvc-showcase
Mark Spritzler wrote:Well, you can put @Transactional on the class level and then all methods from your interfaces that that class implements are now all transactional.
That is a way to put the annotation in once and get many methods covered.
So one trick it to make sure you put all those methods that start with into a single interface that that class implements. Or just put @Transactional on that interface.
Mark
Mark Spritzler wrote:To use @Transactional Annotations. Your config has to have <tx:annotation-driven/> And you need to have a transactionManager bean. That is all. Now you can put @Transactional on any service method and it will be transactional.
No need for any aop or aspect classes. Everything that you did before in xml is taken care of. That is why using annotations for Transactional methods is so much easier than using xml for it.
Mark