[ 
https://issues.apache.org/jira/browse/SLING-2781?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13598710#comment-13598710
 ] 

Carsten Ziegeler commented on SLING-2781:
-----------------------------------------

Yes, I agree...now, I always wanted to implement the ResourceMetadata to be 
fetched lazy as right now these props are read for each and every resource but 
are rarely used. This has some performance impact which could be neglected. Of 
course that would not make this problem go away, but reduce and would also 
allow to update the metadata.
I just realized that the implementation of the jcr value map caches as well, so 
if you adapt the jcr resource to a ValueMap, fetch some values, then adapt to a 
ModifiableValue map, change the previously fetched values, the first value map 
will still return the old values.
This all sounds wrong to me, and all objects returned in some way from the 
resource resolver should display the same state. But that might be a little bit 
more work than I thought - the only other option I see is that we clearly 
document it. However I prefer fixing it as this might lead to interesting 
errors/problems over time
                
> JcrNodeResource is caching resource type
> ----------------------------------------
>
>                 Key: SLING-2781
>                 URL: https://issues.apache.org/jira/browse/SLING-2781
>             Project: Sling
>          Issue Type: Bug
>          Components: JCR
>    Affects Versions: JCR Resource 2.2.4
>            Reporter: Carsten Ziegeler
>             Fix For: JCR Resource 2.2.6
>
>
> The JcrNodeResource caches the resource type, it gets the value in the 
> constructor. If the resource type is changed, for example by setting the 
> sling:resourceType property, the resource object is not updated.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to