Closing Resource Resolver

Avatar

Avatar
Validate 10
Level 3
Radha_Krishna_N
Level 3

Likes

15 likes

Total Posts

51 posts

Correct reply

4 solutions
Top badges earned
Validate 10
Validate 1
Boost 5
Boost 3
Boost 10
View profile

Avatar
Validate 10
Level 3
Radha_Krishna_N
Level 3

Likes

15 likes

Total Posts

51 posts

Correct reply

4 solutions
Top badges earned
Validate 10
Validate 1
Boost 5
Boost 3
Boost 10
View profile
Radha_Krishna_N
Level 3

19-07-2018

Hi,

In AEM 6.1,  we do not have to close the resolver if we are getting resource resolver from sling request or workflow session.

But in an OSGI component if we are getting the ResourceResolver from ResourceResolverFactory as below

@Reference

ResourceResolverFactory rrf;

...

public String getData() {

     ResourceResolver rr = null;

     Map<String, Object> param = ...

     param.put(ResourceResolverFactory.SUBSERVICE, "sub-service");

     try {

          rr = rrf.getServiceResourceResolver(param);

          ...

     }

     ...

}

Do we have to close the resolver?

View Entire Topic

Avatar

Avatar
Give Back
Level 1
shivamurthym775
Level 1

Like

1 like

Total Posts

8 posts

Correct reply

1 solution
Top badges earned
Give Back
Boost 1
Affirm 1
View profile

Avatar
Give Back
Level 1
shivamurthym775
Level 1

Like

1 like

Total Posts

8 posts

Correct reply

1 solution
Top badges earned
Give Back
Boost 1
Affirm 1
View profile
shivamurthym775
Level 1

13-11-2019

I dont think you need to close it. ResourceResolver is Autoclosable.

ResourceResolver ("The Adobe AEM Quickstart and Web Application.")