• 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

Transaction is not rolling back

 
Ranch Hand
Posts: 349
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,
I am using spring declarative transaction by using annotation.
When am forcefully calling the Exception on saveStock() ,,, the rollback is not working .
Here are my code snippet :

In the PersonDAO class




My PersonDao class is somthing like this :



The Stock and Person data are getting saved in the DB.
Here is the output :



Any pointer on this would be appreciable..

Thanks ,
Satya
 
S Majumder
Ranch Hand
Posts: 349
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Solved the problem
I was making few mistakes ..
1) Need to call saveStock() and savePerson() from different service class .
2)I was creating the target object by spring's JDK dynamic proxies ( implemented by its interfaces) , changed that to CGLIB to create the proxy for that target object . By



And CGLIB dependency jar in the classpath

An my app running as expected !!!

Must read Proxying mechanisms

Satya
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic