diff --git a/src/main/java/org/olat/core/gui/Windows.java b/src/main/java/org/olat/core/gui/Windows.java index 728d8a6448a86297663fab24be4d9fa7e45bc00d..bc88533c8da1e6e3702bf30532eef6cbfe563237 100644 --- a/src/main/java/org/olat/core/gui/Windows.java +++ b/src/main/java/org/olat/core/gui/Windows.java @@ -74,16 +74,19 @@ public class Windows implements Disposable { * @return the Windows for this user */ public static Windows getWindows(UserSession us) { - Windows ws = (Windows) us.getEntry(SESSIONID_NAME_FOR_WINDOWS); - if (ws == null) { - ws = new Windows(); - // make window id kind of unique (only needed for better user convenience - // when a user tries to bookmark an url and uses that browser bookmark - // later - //TODO: make error handling better - //ws.windowId = (int) (System.currentTimeMillis() % 10) * 10 + 1; // must - // at least be 1, since 0 is null - us.putEntry(SESSIONID_NAME_FOR_WINDOWS, ws); + Windows ws; + synchronized(us) {//sync the creation of Windows object + ws = (Windows)us.getEntry(SESSIONID_NAME_FOR_WINDOWS); + if (ws == null) { + ws = new Windows(); + // make window id kind of unique (only needed for better user convenience + // when a user tries to bookmark an url and uses that browser bookmark + // later + //TODO: make error handling better + //ws.windowId = (int) (System.currentTimeMillis() % 10) * 10 + 1; // must + // at least be 1, since 0 is null + us.putEntry(SESSIONID_NAME_FOR_WINDOWS, ws); + } } return ws; } diff --git a/src/main/java/org/olat/core/gui/render/velocity/VelocityHelper.java b/src/main/java/org/olat/core/gui/render/velocity/VelocityHelper.java index f61bbaf226a5af125d5dabe62033646f9720f7eb..cb5ef362e1d08f03e59f57cc705e2a8193bcf46d 100644 --- a/src/main/java/org/olat/core/gui/render/velocity/VelocityHelper.java +++ b/src/main/java/org/olat/core/gui/render/velocity/VelocityHelper.java @@ -106,6 +106,8 @@ public class VelocityHelper extends LogDelegator { p.setProperty(RuntimeConstants.RESOURCE_MANAGER_LOGWHENFOUND, "false"); p.setProperty(RuntimeConstants.VM_LIBRARY, "velocity/olat_velocimacros.vm"); + //usefull under heavily load + //p.setProperty("parser.pool.size", "200"); p.setProperty(RuntimeConstants.FILE_RESOURCE_LOADER_CACHE, VelocityModule.isCachePages() ? "true" : "false"); p.setProperty(RuntimeConstants.VM_LIBRARY_AUTORELOAD, VelocityModule.isCachePages() ? "true" : "false"); diff --git a/src/main/java/org/olat/dispatcher/DMZDispatcher.java b/src/main/java/org/olat/dispatcher/DMZDispatcher.java index 3e65120e06e077213e799b5e046ece2366948e06..3d6fec70214d153d657fa55c66419073854006e3 100644 --- a/src/main/java/org/olat/dispatcher/DMZDispatcher.java +++ b/src/main/java/org/olat/dispatcher/DMZDispatcher.java @@ -252,7 +252,9 @@ public class DMZDispatcher implements Dispatcher { UserSession usess = ureq.getUserSession(); Windows ws = Windows.getWindows(usess); - synchronized (ws) { //o_clusterOK by:fj per user session + //sync over the UserSession Instance as the Windows can be recreated in the synchronize block + //and make it useless under heavily load or 2 concurrent requests + synchronized (usess) { //o_clusterOK by:fj per user session Window window; boolean windowHere = ws.isExisting(uriPrefix, ureq.getWindowID()); @@ -298,12 +300,8 @@ public class DMZDispatcher implements Dispatcher { DTabs dts = (DTabs) window.getAttribute("DTabs"); dts.activate(ureq, null, null, ces); } - - window.dispatchRequest(ureq); - - } else { - window.dispatchRequest(ureq); } + window.dispatchRequest(ureq); } } catch (Throwable th) { try {