Joerg Hoh created OAK-11784:
-------------------------------
Summary: new instance of NamespaceRegistry is created whenever a
item is added via XML DocViewImporter
Key: OAK-11784
URL: https://issues.apache.org/jira/browse/OAK-11784
Project: Jackrabbit Oak
Issue Type: Improvement
Components: jcr
Affects Versions: 1.78.0
Reporter: Joerg Hoh
While tracing slow package imports via filevault, I came across this
stacktrace, which appears quite often (around 12% of the times):
{noformat}
[...]
at
org.apache.jackrabbit.oak.plugins.name.ReadOnlyNamespaceRegistry.<init>(ReadOnlyNamespaceRegistry.java:60)
at
org.apache.jackrabbit.oak.plugins.name.ReadWriteNamespaceRegistry.<init>(ReadWriteNamespaceRegistry.java:42)
at
org.apache.jackrabbit.oak.jcr.session.WorkspaceImpl$4.<init>(WorkspaceImpl.java:223)
at
org.apache.jackrabbit.oak.jcr.session.WorkspaceImpl.getNamespaceRegistry(WorkspaceImpl.java:223)
at
org.apache.jackrabbit.commons.NamespaceHelper.registerNamespace(NamespaceHelper.java:196)
at
org.apache.jackrabbit.oak.jcr.xml.ImportHandler.startPrefixMapping(ImportHandler.java:139)
at
org.apache.jackrabbit.vault.fs.impl.io.DocViewImporter.createNewNode(DocViewImporter.java:1117)
[...]
{noformat}
Whenever the NamespaceRegistry is created it reads the namespace tree from the
repository, which is redundant in the context of a single session.
For that the ImportHandler should be able to create the NamespaceRegistry on
its own and then reuse it (instead of letting the
{{NamespaceHelper.registerNamespace()}} re-create it on every invocation.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)