Issue with @Transactional annotations in Spring JPA
I have a doubt related to transactions within transactions. For background, I have a School entity object which has Set of Students entity object mapped to it. I am using Spring Data JPA which is taking care of all the crud operations. I have a SchoolManagementService class which has @Transactional(readonly=true) set at the class level and for all updating methods I am using @Transactional over them. In my SchoolManagementService class I have a method deleteStudents(List) which I have marked as @Transactional. In this method I am calling StudentsRepository.delete(studentId) again and again. I