anchela commented on code in PR #2415:
URL: https://github.com/apache/jackrabbit-oak/pull/2415#discussion_r2243039703
##########
oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/session/SessionContext.java:
##########
@@ -152,6 +155,7 @@ public SessionContext(
this.valueFactory = new ValueFactoryImpl(
delegate.getRoot(), namePathMapper, this.blobAccessProvider);
this.sessionQuerySettings = sessionQuerySettings;
+ this.cacheMap = new HashMap<>();
Review Comment:
hm.... not sure how that works now... you would need to keep it for every
node you take a look at which will result for the cache to get really big. that
doesn't sound good to me.
on the other hand: storing a boolean for each node might also come with some
overhead as one would have to invalidate it upon save/refresh.
##########
oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/session/NodeImpl.java:
##########
@@ -1342,8 +1344,11 @@ protected Tree createValue() {
}
private boolean canReadMixinTypes(@NotNull Tree tree) {
- return sessionContext.getAccessManager().hasPermissions(
- tree, EMPTY_MIXIN_TYPES, Permissions.READ_PROPERTY);
+ // cache this information per SessionContext, as it is valid
independent of the node
Review Comment:
that is actually not correct.
whether or not the mixin type property can be read for a particular tree may
vary from tree to tree.
so caching it for the first tree you encounter is not correct.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]