I need a thread safe ResourceResolver that can be used for CRUD operations but nothing says using the ResourceResolverFactory is or isn't thread safe.
Solved! Go to Solution.
Views
Replies
Total Likes
ResourceResolver is as stated not thread safe, therefore it should not be used concurrently by different threads. However, if you create the resource resolver through the factory yourself you can pass it on to another thread.
Reference : https://www.mail-archive.com/users@sling.apache.org/msg03803.html
Hi @Art_Bird
A ResourceResolver is generally not thread safe! As a consequence, an application which uses the resolver, its returned resources and/or objects resulting from adapting either the resolver or a resource, must provide proper synchronization to ensure no more than one thread concurrently operates against a single resolver, resource or resulting objects. Please check below links for more info.
https://kiransg.com/2021/11/07/aem-resource-resolver-commit-save-best-practices/
I understand the ResourceResolver isn't thread safe.
My question is a ResourceResolver that has been created using the ResourceResolverFactory considered thread safe?
ResourceResolver is as stated not thread safe, therefore it should not be used concurrently by different threads. However, if you create the resource resolver through the factory yourself you can pass it on to another thread.
Reference : https://www.mail-archive.com/users@sling.apache.org/msg03803.html
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies