posted 19 years ago
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 ]