Skip to content
Snippets Groups Projects
Commit 932fd665 authored by srosse's avatar srosse
Browse files

OO-1584: commit and close the connection before copying the files

parent 07aa9125
No related branches found
No related tags found
No related merge requests found
......@@ -416,6 +416,9 @@ public class CourseFactory extends BasicManager {
PersistingCourseImpl targetCourse = new PersistingCourseImpl(targetRes.getResourceableId());
File fTargetCourseBasePath = targetCourse.getCourseBaseContainer().getBasefile();
//close connection before file copy
DBFactory.getInstance(false).commitAndCloseSession();
synchronized (sourceCourse) { // o_clusterNOK - cannot be solved with doInSync since could take too long (leads to error: "Lock wait timeout exceeded")
// copy configuration
CourseConfig courseConf = CourseConfigManagerImpl.getInstance().copyConfigOf(sourceCourse);
......@@ -439,9 +442,6 @@ public class CourseFactory extends BasicManager {
File fSourceTaskfoldernodesFolder = new File(FolderConfig.getCanonicalRoot()
+ TACourseNode.getTaskFoldersPathRelToFolderRoot(sourceCourse.getCourseEnvironment()));
if (fSourceTaskfoldernodesFolder.exists()) FileUtils.copyDirToDir(fSourceTaskfoldernodesFolder, fTargetCourseBasePath, false, "copy task folder directories");
//make sure the DB connection is available after this point
DBFactory.getInstance(false).commitAndCloseSession();
// update references
List<Reference> refs = referenceManager.getReferences(sourceCourse);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment