diff --git a/AxonIvyPortal/portal/src/ch/addon/portal/generic/menu/MenuView.java b/AxonIvyPortal/portal/src/ch/addon/portal/generic/menu/MenuView.java index e56ded8a3a..59f81315b5 100644 --- a/AxonIvyPortal/portal/src/ch/addon/portal/generic/menu/MenuView.java +++ b/AxonIvyPortal/portal/src/ch/addon/portal/generic/menu/MenuView.java @@ -268,7 +268,7 @@ public PortalDashboardItemWrapper getDashboardCache() { } if (portalDashboardItemWrapper == null) { - synchronized (PortalDashboardItemWrapper.class) { + synchronized (this) { portalDashboardItemWrapper = new PortalDashboardItemWrapper(DashboardUtils.collectDashboards()); cacheService.setSessionCache(IvyCacheIdentifier.PORTAL_DASHBOARDS, sessionUserId, portalDashboardItemWrapper); } diff --git a/AxonIvyPortal/portal/src/ch/ivy/addon/portalkit/util/DashboardUtils.java b/AxonIvyPortal/portal/src/ch/ivy/addon/portalkit/util/DashboardUtils.java index 7fc57b2b58..c8dd6cdf6b 100644 --- a/AxonIvyPortal/portal/src/ch/ivy/addon/portalkit/util/DashboardUtils.java +++ b/AxonIvyPortal/portal/src/ch/ivy/addon/portalkit/util/DashboardUtils.java @@ -66,7 +66,7 @@ public static List getPublicDashboards() { } if (portalPublicDashboardWrapper == null) { - synchronized (PortalPublicDashboardWrapper.class) { + synchronized (sessionUserId.intern()) { List dashboards = new ArrayList<>(); try { String dashboardJson = Ivy.var().get(PortalVariable.DASHBOARD.key); @@ -100,7 +100,7 @@ public static List getPrivateDashboards() { } if (portalPrivateDashboardWrapper == null) { - synchronized (PortalPublicDashboardWrapper.class) { + synchronized (sessionUserId.intern()) { List dashboards = new ArrayList<>(); try { String dashboardInUserProperty = readDashboardBySessionUser();