In a project I need to import a CSV file into database, and the operation must be rollbacked in the case of any problem. A service calls a helper to read data from file and put them in a List , then it calls a repository extending CrudRepository to persist data with saveAll() . I added @Transactional annotations above the repository’s saveAll() and the service’s import method.