On 2015-04-08 10:10, Felix Meschberger wrote:
Hi Joel

Thanks for pointing out. Yet, this has been discussed before.

Turns out that checking for item existence before accessing the item is JCR API 
best practice. So Sling follows best practice.

Why would it be best practice? You need to handle an exception anyway (due to possible race conditions).

If this generates a performance problem, I would suggest this to fix in the 
implementation of the API such that API usage best practice guidelines can be 
follows.

Regarding the performance impact: If this createResource method has such a 
dramatic impact on request processing performance in Sling, it might be that 
Session.itemExists and/or Session.getItem methods are really expensive. Which 
would be yet another reason why we should concentrate on improving the 
implementation rather than introducing new API.

Regards
Felix
...


Best regards, Julian

Reply via email to