I wanted to get some opinions on this first. Created 
https://issues.apache.org/jira/browse/SLING-3524

Cheers,
Alex

On 27.04.2014, at 04:43, Carsten Ziegeler <[email protected]> wrote:

> Well, I'm just stating the docs, feel free to open an issue to get this
> changed.
> 
> Thanks
> Carsten
> 
> 
> 2014-04-25 21:43 GMT+02:00 Alexander Klimetschek <[email protected]>:
> 
>> On 25.04.2014, at 00:21, Carsten Ziegeler <[email protected]> wrote:
>> 
>>> The documentation of clone clearly states that if "null" is passed in:
>> "the
>>> same credential data is used as was used to create this instance." which
>> in
>>> turn means, if the initlal resolver was created based on a session, this
>>> one will share the session.
>> 
>> There are a few problems with this:
>> - seeing the session object itself as "credential data" is unintuitive
>> - in my code, I have no idea what the original credential data was, so I
>> don't know what kind of credential data it was to make the right decision
>> - since sharing a JCR session is to be avoided at all times, the resource
>> resolver should prevent one from this
>> 
>> Are there any cases where you want a cloned resolver to share the session?
>> 
>>> So in your case, you have to create a new session and pass this into the
>>> clone method - or you can also call the resource resolver factory
>> directly.
>> 
>> Which is A LOT of boilerplate given there already is a clone() method. It
>> is not so much if using the USER_IMPERSONATION, but still, clone(null)
>> would be great to reflect a session clone = impersonate itself.
>> 
>> Cheers,
>> Alex
>> 
>> 
> 
> 
> -- 
> Carsten Ziegeler
> [email protected]

Reply via email to