• 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
  • Liutauras Vilda
  • Paul Clapham
Sheriffs:
  • paul wheaton
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Piet Souris
Bartenders:
  • Mike London

Spring Transaction Problem

 
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,

I am struggling with transactions. I am trying to add transaction for storeData() method available in a service class.
here is my configuration.



Can any one please help me.
 
ranger
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I would add

<tx:annotation--driven>

remove the FactoryBean bean in your xml and then just put @Transactional on your service class.

Mark
 
praneeth ram
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I added @Transactional. but how to add <tx:annotation--driven> in xml file.
 
Mark Spritzler
ranger
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

praneeth ram wrote:I added @Transactional. but how to add <tx:annotation--driven> in xml file.



Add the Spring tx namespace, then just add that String in your xml file. Just like you are using <bean> that comes from Spring's bean namespace.

If you are using STS, there is a tab below the xml file called "namespaces" you can select that tab and see checkboxes. Find the one for the tx namespace and select it, now you add <tx:annotation-driven>

Mark
 
reply
    Bookmark Topic Watch Topic
  • New Topic