I want to update entire database in mysql database through my spring application (hibernate 4, spring 1.4.5). Steps: 1. delete entire data from DB 2. update new record 3. rollback if 1 or 2 fails
How do I achieve with @Transactional? 
I have used org.springframework.transaction.annotation.Transactional and propagation = MANDATORY.
But I can see the table get deleted while it is still in the same Transactional Method.
@Transactional(propagation = Propagation.MANDATORY)
private void testMtd(List<Data> data){
  repository.deleteAll();
  repository.save(data);
}
How can I overcome this problem?
 
                        
Annotating the Application started class (main class) with
@EnableTransactionManagementwill work.