Reputation: 7394
I have an application that is using `Spring data'.
I want to ensure that either both deletions (code below) are carried out, or for a rollback to happen.
How can I ensure that .delete()
methods shown below are transactional
?
@Service
public class databaseService{
//some code
public void deleteRows(){
carRepository.delete(car);
personRepository.delete(person);
}
}
Upvotes: 1
Views: 66