I am reveiewing the code for one of the senior member for the first peer review so he added @Transactional annotation at custom repository with delete method. The custom Repository delete method is being called in one of the Asychronous service method.
public interface DeviceRepository extends
JpaRepository<Device, Long>, JpaSpecificationExecutor<Device> {
@Transactional
void deleteDeviceByDeviceName(String deviceName);
}
do we need to use @Transactional method Repository layer, will impact anything like performanance.
any scenario’s to use @Transactional annotation at JPA Repository layer?