diff --git a/dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/mapping/DefaultMappingService.java b/dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/mapping/DefaultMappingService.java index 63ce13bb6ae..86f77d0ed97 100644 --- a/dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/mapping/DefaultMappingService.java +++ b/dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/mapping/DefaultMappingService.java @@ -187,6 +187,7 @@ public int countMapViewMaps(MapView mapView) { } @Override + @Transactional(readOnly = true) public List findByProgram(Program program) { return mapViewStore.findByProgram(program); } diff --git a/dhis-2/dhis-test-integration/src/test/java/org/hisp/dhis/program/ProgramServiceTest.java b/dhis-2/dhis-test-integration/src/test/java/org/hisp/dhis/program/ProgramServiceTest.java index 186b24e3130..87163e1b391 100644 --- a/dhis-2/dhis-test-integration/src/test/java/org/hisp/dhis/program/ProgramServiceTest.java +++ b/dhis-2/dhis-test-integration/src/test/java/org/hisp/dhis/program/ProgramServiceTest.java @@ -167,8 +167,6 @@ void testDeleteProgramWithMapView() { mapView.setProgramStage(programStageA); mappingService.addMapView(mapView); assertDoesNotThrow(() -> programService.deleteProgram(programA)); - - entityManager.flush(); mapView = mappingService.getMapView(mapView.getId()); assertNull(mapView.getProgram()); assertNull(mapView.getProgramStage());