File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Spring and the fly likes Spring Transaction Problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "Spring Transaction Problem" Watch "Spring Transaction Problem" New topic
Author

Spring Transaction Problem

praneeth ram
Ranch Hand

Joined: Sep 21, 2009
Posts: 60
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

Joined: Feb 05, 2001
Posts: 17249
    
    6

I would add

<tx:annotation--driven>

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

Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
praneeth ram
Ranch Hand

Joined: Sep 21, 2009
Posts: 60
I added @Transactional. but how to add <tx:annotation--driven> in xml file.
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17249
    
    6

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
 
subject: Spring Transaction Problem
 
Similar Threads
unsatisfied Dependancy exception
I am getting org.springframework.orm.hibernate3.HibernateSystemException: Unknown entity:
Migrating from Spring 2.0 and Hibernate 3.0 to Spring 3.1 and Hibernate 4.1
HibernateDaoSupport and Transaction
Spring-Hibernate transaction management