Hi,
I'm using Spring 3.1.0.RELEASE. I want to use Spring's @Transaction annotation to manage my transactions in my service class. I have three methods marked with "@Transactional(readOnly=false)" and one of them invokes the other two ...
Will the method that invokes the other two, "refreshEventsDb", execute as a single transaction? If not, how do I make it do that?Code:@Transactional(readOnly=false) public void refreshEventsDb() { // Purge everything from Events table. deleteAllEvents(); final Set<EventFeed> eventFeeds = eventFeedsDao.getAllEventFeeds(); for (final EventFeed eventFeed : eventFeeds) { final List<Event> allEvents = eventFeed.getEvents(); for (final Event event : allEvents) { if (!event.isInThePast()) { saveEvent(event); } // if } // for } // for } // refreshEventDb @Transactional(readOnly = false) public void saveEvent(final Event event) { ... } // saveEvent @Transactional(readOnly=false) public void deleteAllEvents() { ... }
Thanks, - Dave


Reply With Quote