Skip to content

Commit 3d9835e

Browse files
committed
add flush to avoid hitting the duplicate constraint issue
1 parent f6c3f3f commit 3d9835e

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

api/src/main/java/ca/bc/gov/educ/api/pen/replication/service/TraxStudentCourseService.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ public void deletePriorAndSaveTraxStudentCourses(final List<TraxStudentCourseEnt
2929
try {
3030
if(!existingCourseList.isEmpty()) {
3131
log.info("Removing existing course list for PEN: {}", existingCourseList.get(0).getStudXcrseId().getStudNo());
32-
this.traxStudentCourseRepository.deleteAll(existingCourseList);
32+
this.traxStudentCourseRepository.deleteAllInBatch(existingCourseList);
33+
this.traxStudentCourseRepository.flush();
3334
}
3435

3536
if(!studentCourseEntityList.isEmpty()) {

0 commit comments

Comments
 (0)