You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@sling.apache.org by Sandro Boehme <sa...@gmx.de> on 2012/12/23 18:14:07 UTC
taking advantage of the transient space in Sling
Hello,
currently I'm working on edit features for nodes in the JCRBrowser [1].
My goal is to be able to make modifications (delete, move,... nodes)
without saving them immediately but save them all together with
Session.save() separately at a later point in time.
Right now I'm using the SlingPostServlet 2.1.2 which contains a
configuration to skip session.save in AbstractPostOperation [2]. I'm
using a servlet filter to detect if my ":transient_operation" request
parameter is set and set the "skip-session-handling" request attribute
of SLING-2227 in that case. There is no problem with that. If you want,
I could provide a simple patch that does that right in the
AbstractPostOperation.
The problem is that something seems to discard my delete, move,...
operation (by a session.refresh(false)?) as on the next request the
changes are not reflected in the session anymore. The session is in a
state as if I would have never changed it.
Does Sling support using the transient space or is there something I can
do to take advantage of it?
Thanks in advance for any hints!
Best,
Sandro
[1] - http://www.jcrbrowser.com/sling
[2] - https://issues.apache.org/jira/browse/SLING-2227
Re: taking advantage of the transient space in Sling
Posted by Sandro Boehme <sa...@gmx.de>.
Thanks for your quick feedback Justin.
Now I remember. Thats because of the concurrency issues with the JCR
session.
Best,
Sandro
Am 23.12.12 21:23, schrieb Justin Edelson:
> Sandro-
> In the situation you are describing, the "next request" is getting a new
> JCR session. The Sling engine always creates a new JCR session for each
> request. Sling does not have a way to reuse JCR sessions between requests.
>
> Regards,
>
> Justin
>
> On Dec 23, 2012 12:14 PM, "Sandro Boehme" <sa...@gmx.de> wrote:
>
>> Hello,
>>
>> currently I'm working on edit features for nodes in the JCRBrowser [1]. My
>> goal is to be able to make modifications (delete, move,... nodes) without
>> saving them immediately but save them all together with Session.save()
>> separately at a later point in time.
>> Right now I'm using the SlingPostServlet 2.1.2 which contains a
>> configuration to skip session.save in AbstractPostOperation [2]. I'm using
>> a servlet filter to detect if my ":transient_operation" request parameter
>> is set and set the "skip-session-handling" request attribute of SLING-2227
>> in that case. There is no problem with that. If you want, I could provide a
>> simple patch that does that right in the AbstractPostOperation.
>> The problem is that something seems to discard my delete, move,...
>> operation (by a session.refresh(false)?) as on the next request the changes
>> are not reflected in the session anymore. The session is in a state as if I
>> would have never changed it.
>>
>> Does Sling support using the transient space or is there something I can
>> do to take advantage of it?
>>
>> Thanks in advance for any hints!
>>
>> Best,
>>
>> Sandro
>>
>>
>> [1] - http://www.jcrbrowser.com/**sling <http://www.jcrbrowser.com/sling>
>> [2] - https://issues.apache.org/**jira/browse/SLING-2227<https://issues.apache.org/jira/browse/SLING-2227>
>>
>
Re: taking advantage of the transient space in Sling
Posted by Justin Edelson <ju...@justinedelson.com>.
Sandro-
In the situation you are describing, the "next request" is getting a new
JCR session. The Sling engine always creates a new JCR session for each
request. Sling does not have a way to reuse JCR sessions between requests.
Regards,
Justin
On Dec 23, 2012 12:14 PM, "Sandro Boehme" <sa...@gmx.de> wrote:
> Hello,
>
> currently I'm working on edit features for nodes in the JCRBrowser [1]. My
> goal is to be able to make modifications (delete, move,... nodes) without
> saving them immediately but save them all together with Session.save()
> separately at a later point in time.
> Right now I'm using the SlingPostServlet 2.1.2 which contains a
> configuration to skip session.save in AbstractPostOperation [2]. I'm using
> a servlet filter to detect if my ":transient_operation" request parameter
> is set and set the "skip-session-handling" request attribute of SLING-2227
> in that case. There is no problem with that. If you want, I could provide a
> simple patch that does that right in the AbstractPostOperation.
> The problem is that something seems to discard my delete, move,...
> operation (by a session.refresh(false)?) as on the next request the changes
> are not reflected in the session anymore. The session is in a state as if I
> would have never changed it.
>
> Does Sling support using the transient space or is there something I can
> do to take advantage of it?
>
> Thanks in advance for any hints!
>
> Best,
>
> Sandro
>
>
> [1] - http://www.jcrbrowser.com/**sling <http://www.jcrbrowser.com/sling>
> [2] - https://issues.apache.org/**jira/browse/SLING-2227<https://issues.apache.org/jira/browse/SLING-2227>
>