Am Montag, den 18.02.2008, 09:54 +0100 schrieb Bertrand Delacretaz: > On Feb 14, 2008 12:03 PM, Felix Meschberger <[EMAIL PROTECTED]> wrote: > > > ...To be able to cleanup the ThreadLocals a new release(ResourceResolver) > > is defined, which is required to be called for all ResourceResolver > > instances retrieved through getResourceResolver(Session).... > > Could this cleanup phase be integrated in the Sling core, for example > at the end of request processing in the SlingMainServlet? > > I could imagine objects such as this ResourceResolverProvider > registering cleanup methods when objects that need cleanup are > created, to make it impossible to forget to clean them up.
I think this is self-explanatory: If we say, the one causing the ResourceResolver to be created, must also release it. So if the Sling Main Servlet causes the creation (by calling JcrResourceResolverFactory.getResourceResolver(Session)) it will also release the ResourceResolver by calling JcrResourceResolverFactory.release(ResourceResolver) at the end of the request. Regards Felix