Transactions, Spring.
//Checked Exception if(user.age < 18) throw UserNotEligibleToDriveException(); //below line not executed userRepository.save(user); } } Because the user is a persistent entity, hibernate persists the user object to DB and the new phone number is updated, even though the save method is not executed.