Refactor magnolia Context class hierarchy (MAGNOLIA-1614)

[MAGNOLIA-1800] SystemContext should not share the jcr session for all threads Created: 25/Oct/07  Updated: 23/Jan/13  Resolved: 02/Nov/07

Status: Closed
Project: Magnolia
Component/s: None
Affects Version/s: 3.1 M3
Fix Version/s: 3.5 RC1

Type: Sub-task Priority: Major
Reporter: Philipp Bärfuss Assignee: Philipp Bärfuss
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Template:
Date of First Response:

 Description   

The jcr session is not thread safe so it is wrong that all calls to MgnlContext.getSystemContext().getHierarchyManager() get the same object.

This can be solved by implementing getSystemContext() very similar to MgnlContext.getInstance() by using a thread local. All this object have shared attributes, AccessManager, but acquire the jcr session (HierarchyManager) the same way as the other contexts do



 Comments   
Comment by ashapochka [ 02/Nov/07 ]

Now HierarchyManagers are held threadlocally in HierarchyManagerLoaders in ContentRepository. To factor out them from ContentRepository altogether would have lead to too many changes in the code. So instead of storing HierarchyManager instances in ContentRepository.hierarchyManagers we store the loaders with the same keys

Generated at Mon Feb 12 03:30:27 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.