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


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Frameworks » Other Application Frameworks
Bookmark "Spring 2.5 @Transactional not working" Watch "Spring 2.5 @Transactional not working" New topic
Author

Spring 2.5 @Transactional not working

Lisa Ray
Greenhorn

Joined: Mar 05, 2009
Posts: 22
Hi All,
I'm using annotation-based Spring 2.5 in my service layer. The service calls DAO. It seems that service is not wrapped in a transaction which causes the Hibernate DAO to fail.

My Configuration file looks like this:



Following is the Service impl class:




Please suggest in case I'm missing something here.


Thanks
Lisa
Nathan Pruett
Bartender

Joined: Oct 18, 2000
Posts: 4121

Is that the only configuration file, or are there more? I don't see the '<tx:annotation-driven/>' in your configuration. Or a TransactionManager, or a DataSource defined.


-Nate
Write once, run anywhere, because there's nowhere to hide! - /. A.C.
Lisa Ray
Greenhorn

Joined: Mar 05, 2009
Posts: 22
Hi Nathan, Thanks for the post. For the sake of brevity I didn't post the entire app context XML. Here's the Spring XML:




I'm sure that the beans have been wired correctly, else I would have got a fat parser error. The only concern is that the service layer is not wrapped in a transaction. Because of which I get the following exception from the DAO layer:


Thanks
Lisa
Lisa Ray
Greenhorn

Joined: Mar 05, 2009
Posts: 22
Hi Ranchers,
I'm not sure if this is really a Spring issue or Hibernate ORM problem. I changed the transaction strategy to use AOP, as shown below:


Now even with the new changes in place, I get the following error:







- Lisa
 
 
subject: Spring 2.5 @Transactional not working