File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Spring Transaction Problem

 
praneeth ram
Ranch Hand
Posts: 60
  • 0
  • Mark post as helpful
  • send pies
  • 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.
 
Mark Spritzler
ranger
Sheriff
Posts: 17276
6
IntelliJ IDE Mac Spring
  • 0
  • Mark post as helpful
  • send pies
  • 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
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I added @Transactional. but how to add <tx:annotation--driven> in xml file.
 
Mark Spritzler
ranger
Sheriff
Posts: 17276
6
IntelliJ IDE Mac Spring
  • 0
  • Mark post as helpful
  • send pies
  • 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
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic