Hi guys, I’ve been working on a project for some time with the following components:
- Struts2.1.8.1,
- Spring 3.0.3
- JPA 2.0,
- Hibernate 3
I use Spring EntityManager magic ... But I am having transaction problems inside my actions. For example, I set values on my saved object in several ways in my class, and I want to be able rollbackto if the method validatedetects a validation error, or committhese changes otherwise. I have read half the Internet for a long time to get a comprehensive explanation. Unfortunately, no complete examples exist (at least it looks like my stack).
I stumbled upon this thread on the mailing list: @Transactional Spring Annotation in action Struts2 does not work . The message I am linking seems to have a fairly simple and straightforward solution, using it TransactionInterceptorwill do the trick that seems ... The problem is that I cannot find useful information about this interceptor.
Does anyone have any experience with this technology and can you consult a link or two on how to use Spring transactions inside Struts2 actions?
Thank!
- Change 1 -
I created a test project, if you're interested, just upload the file and try it (or check). Thank!
source
share