From 19bc44d8ad22181842958ef2252b4d3b392d9c42 Mon Sep 17 00:00:00 2001
From: uhensler <urs.hensler@frentix.com>
Date: Wed, 8 Apr 2020 15:26:45 +0200
Subject: [PATCH] OO-4207: Hardening creation of assessment entries a little
 bit

---
 .../assessment/manager/CourseAssessmentServiceImpl.java     | 6 +-----
 src/main/java/org/olat/upgrade/OLATUpgrade_15_pre_0.java    | 2 ++
 2 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/src/main/java/org/olat/course/assessment/manager/CourseAssessmentServiceImpl.java b/src/main/java/org/olat/course/assessment/manager/CourseAssessmentServiceImpl.java
index 3f0b56b245b..0f8800b1c54 100644
--- a/src/main/java/org/olat/course/assessment/manager/CourseAssessmentServiceImpl.java
+++ b/src/main/java/org/olat/course/assessment/manager/CourseAssessmentServiceImpl.java
@@ -395,15 +395,11 @@ public class CourseAssessmentServiceImpl implements CourseAssessmentService, Nod
 		List<Identity> members = repositoryService.getMembers(courseEntry, RepositoryEntryRelationType.all, GroupRoles.participant.name());
 		identities.addAll(members);
 		
-		int count = 0;
 		for(Identity identity: identities) {
 			evaluateAll(courseEnv, identity);
 			log.debug("Evaluated score accounting in course {} for {}", course, identity);
-			if(++count % 10 == 0) {
-				dbInstance.commitAndCloseSession();
-			}
+			dbInstance.commitAndCloseSession();
 		}
-		dbInstance.commitAndCloseSession();
 	}
 
 	private void evaluateAll(CourseEnvironment courseEnv, Identity assessedIdentity) {
diff --git a/src/main/java/org/olat/upgrade/OLATUpgrade_15_pre_0.java b/src/main/java/org/olat/upgrade/OLATUpgrade_15_pre_0.java
index 9157bd0b663..20a960295a2 100644
--- a/src/main/java/org/olat/upgrade/OLATUpgrade_15_pre_0.java
+++ b/src/main/java/org/olat/upgrade/OLATUpgrade_15_pre_0.java
@@ -149,6 +149,8 @@ public class OLATUpgrade_15_pre_0 extends OLATUpgrade {
 				if (runStructure != null) {
 					CourseNode rootNode = runStructure.getRootNode();
 					if (rootNode != null) {
+						log.info("Assessment entries migration started: course {} ({}).",
+								repositoryEntry.getKey(), repositoryEntry.getDisplayname());
 						String ident = rootNode.getIdent();
 						setRootEntryTrue(repositoryEntry, ident);
 						setRootEntryFalse(repositoryEntry, ident);
-- 
GitLab