Win a copy of Java Challengers this week in the Java in General forum!
  • 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
  • Paul Clapham
  • Ron McLeod
  • paul wheaton
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Liutauras Vilda
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Piet Souris
Bartenders:
  • salvin francis
  • Mikalai Zaikin
  • Himai Minh

Spring 2.5 @Transactional not working

 
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Bartender
Posts: 4121
IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Lisa Ray
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic