• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Beginner needs help with Spring + JPA + Transactions

 
Ranch Hand
Posts: 384
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Try changing your save method to:
 
Julien Martin
Ranch Hand
Posts: 384
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 364
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 384
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello again,
I found the solution. I added this in my class:



Thanks again to all,

Julien.
 
reply
    Bookmark Topic Watch Topic
  • New Topic