Beginner needs help with Spring + JPA + Transactions
Julien Martin
Ranch Hand
Joined: Apr 24, 2004
Posts: 383
posted
0
Hello,
I am new to spring and jpa and I cannot get the spring @Transactional annotation to work. My environment is as follows: -Tomcat 6 -Spring wef flow + JSF -JPA + Hibernate -Spring RC1
Here is the content of my appcontext :
and here is my dao:
The method that calls the DAO:
And yet nothing is committed. I don't want to have programmatic commits in my app.
What am I getting wrong?
Julien.
PS. I searched the forum for an problem and environment similar to mine but to no avail.
Susanta Chatterjee
Ranch Hand
Joined: Aug 12, 2002
Posts: 102
posted
0
Try changing your save method to:
Julien Martin
Ranch Hand
Joined: Apr 24, 2004
Posts: 383
posted
0
No no. The whole point of using Spring is to have the automatic transaction demarcation with the @Transactional annotation. I don't want to do manual commits.... Any other idea? J.
Edvins Reisons
Ranch Hand
Joined: Dec 11, 2006
Posts: 364
posted
0
Julien,
if you believe that this question is about Spring (you may try to port the code to, say, EJB, to check this), there is an Application Frameworks forum on this site for discussions of Spring. [ November 19, 2007: Message edited by: Edvins Reisons ]
Julien Martin
Ranch Hand
Joined: Apr 24, 2004
Posts: 383
posted
0
Hello again, I found the solution. I added this in my class:
Thanks again to all,
Julien.
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.
subject: Beginner needs help with Spring + JPA + Transactions