[dna-issues] [JBoss JIRA] Commented: (DNA-301) Most state managed within the Workspace should be shared among multiple Session instances
Randall Hauch (JIRA)
jira-events at lists.jboss.org
Tue Mar 17 00:47:22 EDT 2009
[ https://jira.jboss.org/jira/browse/DNA-301?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12457587#action_12457587 ]
Randall Hauch commented on DNA-301:
-----------------------------------
The current design is intensionally not thread-safe. According to the JCR spec, Session is not safe to be called concurrently by multiple threads. So, by having each session have its own workspace (and associated state), each session's workspace owns copies of the namespace registry and node type manager. Moving to a design where each session's workspace uses a shared namespace registry and node type manager would mean these now need to be thread-safe (since they're concurrently accessible and updatable through separate Sessions and threads).
So, currently we can have no locking because each workspace has its own copies. And since there will likely not be large numbers of node types or namespace mappings, memory usage probably won't be a problem even with large numbers of Sessions (and therefore Workspaces). IMO, the larger problem will be the time required to update all these copies when a change is made, and any latency between the change and the last session to be made aware of the change.
I'm not convinced that these changes need to be in 0.4, so I'm willing to push them. I am interested in feedback, however.
> Most state managed within the Workspace should be shared among multiple Session instances
> -----------------------------------------------------------------------------------------
>
> Key: DNA-301
> URL: https://jira.jboss.org/jira/browse/DNA-301
> Project: DNA
> Issue Type: Task
> Components: API, JCR
> Affects Versions: 0.3
> Reporter: Randall Hauch
> Fix For: 0.4
>
>
> Our current JcrWorkspace implementation is created to be used only by the one JcrSession instance associated with it. Currently, each Session would have it's own Workspace implementation, each of which would have its own copy of the namespace registry and node type manager.
> However, one common use case for JCR involves creating many Session instances for the same workspace (e.g., this is the web app scenario). This means that we'd have a lot of Workspace instances (same number as Session instances) each with their own copy of the data. In fact, the node type manager should actually be "owned" (at least logically) by the repository, per section 6.7.9: "There is one node type registry per repository, therefore the NodeTypeManager is not workspace-specific; it provides introspection methods for the global, repository-wide set of available node types."
> Therefore, a number of things that are currently in the JcrWorkspace implementation should be pulled out and reused for all JcrWorkspace instances created by the JcrRepository for the same logical workspace. This issue captures the set of tasks that are involved.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the dna-issues
mailing list