• 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
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Problems with Spring Transactions Support

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

I'll try to explain the problem as clear as possible.

I have a web app with Hibernate on persistence layer.

I have a service class called UserServiceImpl with a dependency to a DAO object. In my service class, there is a method called updatePrefixes() that invokes two methods on DAO object: a method removeAll(Object) and another one to insertAll(Object).



These methods are called in the followin order:
dao.removeAll();
dao.insertAll();

I've declared the service's methods to be managed by Spring Transaction in the applicationContext.xml:




The PROPAGATION_REQUIRED transaction definition means that the DAO's methods will execute in the service's method transaction.

The problems is that the DAO's removeAll() method is called after the insertAll() method.

How can I do to execute the DAO's mehtods in the order that they were declared?

Thanks a lot.
[ April 14, 2005: Message edited by: Regis Santos ]
 
reply
    Bookmark Topic Watch Topic
  • New Topic