I have a method, \'databaseChanges\', which call 2 operations: A, B in iterative way. \'A\' first, \'B\' last. \'A\' & \'B\' can be Create, U
The first code you present is for UserTransactions, i.e. the application has to do the transaction management. Usually you want the container to take care of that and use the @Transactional annotation. I think the problem in you case might be, that you have the annotation on a private method. I'd move the annotation to the class level
@Transactional
public class MyFacade {
public void databaseChanges() throws Exception {
A(); //update.
B(); //insert
}
Then it should rollback properly. You can find more details here Does Spring @Transactional attribute work on a private method?