jackrabbit-oak-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marcel Reutegger <mreut...@adobe.com>
Subject ContentSession.getCurrentRoot() usage
Date Wed, 12 Sep 2012 13:30:52 GMT

AFAIU ContentSession.getCurrentRoot() will return the most
up to date version of the root, which provides access to a
snapshot of the tree. In oak-jcr this method is used when
a SessionDelegate is created and the root is initialized with
getCurrentRoot(). Later on this root is used for operations
on the tree.

now, there are also a lot of other places where getCurrentRoot()
is called. some of these look a bit suspicious to me. the
namespace registry and node type manager operate mostly
on fresh snapshots of the tree for each method call. doesn't
that always result in a call all the way down to the microkernel?
I know that both namespace and node type management are
considered repository wide and not bound to the current session,
but it seems excessive to always get a new snapshot for a
namespace uri to prefix mapping that rarely changes.

another usage I noticed is in Query.getTree(String). Shouldn't
the query rather operate on the same stable tree as seen by
the JCR session?


View raw message