Hi Team,
Issue -
1. Usage of org.apache.sling.api.resource.ResourceResolver as a field is not thread safe.
2. Usage of javax.jcr.Session as a field is not thread safe.
3. ResourceResolver, Session should be closed in finally block.
Critical in SonarQube through CloudManager. What is the workaround for this scenario to handle in code. Below code quality documents not talks about the Thread safe scenario.
We are using serviceUser and we are taking serviceResourceResolver and there is no pointer how to resolve those scenario's.
If we close the resourceResolver and Session then it will not work as expected.
Thanks,
Kiran Parab
Solved! Go to Solution.
Views
Replies
Total Likes
Are your service user based resolvers operated within a try-with-resources block? https://cqdump.joerghoh.de/2018/11/14/try-with-resource-or-i-will-never-forget-to-close-a-resource-r...
request resolvers and session resolvers need not be closed. Also curios if adding @SuppressWarnings annotation helps..
Are your service user based resolvers operated within a try-with-resources block? https://cqdump.joerghoh.de/2018/11/14/try-with-resource-or-i-will-never-forget-to-close-a-resource-r...
request resolvers and session resolvers need not be closed. Also curios if adding @SuppressWarnings annotation helps..