From 0c65bbab0a7d170d66ac0b5a7bc09efceb79ba60 Mon Sep 17 00:00:00 2001 From: tomas-muller Date: Fri, 24 Jan 2025 10:03:49 +0100 Subject: [PATCH] Online Student Scheduling: Enroll (Hiberante 6.6 Fix) - fixed a Hibernate error: persistent instance references an unsaved transient instance of CourseDemand - thrown when dropping a course demand that was wait-listed in the past - likely caused by Student.resetWaitLists(..) touching previuous WaitList records that refer the course demand that was just deleted --- .../timetable/onlinesectioning/updates/EnrollStudent.java | 1 + 1 file changed, 1 insertion(+) diff --git a/JavaSource/org/unitime/timetable/onlinesectioning/updates/EnrollStudent.java b/JavaSource/org/unitime/timetable/onlinesectioning/updates/EnrollStudent.java index 157fd9a376..16d040fdaf 100644 --- a/JavaSource/org/unitime/timetable/onlinesectioning/updates/EnrollStudent.java +++ b/JavaSource/org/unitime/timetable/onlinesectioning/updates/EnrollStudent.java @@ -784,6 +784,7 @@ else if (!courseId.equals(ca.getCourseId())) { helper.getHibSession().merge(student); if (wlMode == WaitListMode.WaitList) { + helper.getHibSession().flush(); student.resetWaitLists( WaitList.WaitListType.SCHEDULING_ASSISTANT, helper.getUser().getExternalId(),