jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vkrejcirik <vkrejci...@gmail.com>
Subject Re: eventListener doesn't work
Date Mon, 16 Mar 2009 09:44:32 GMT
I have session, where i registered event listener, still open. I have 
another session, where i add nodes and properties. I connect to sling 
repo over rmi, so the session is not in the osgi container.

Best regards / S pozdravem
Vladislav Krejc(ir(ík


Alexander Klimetschek napsal(a):
> On Sun, Mar 15, 2009 at 4:58 PM, vkrejcirik <vkrejcirik@gmail.com> wrote:
>> After registering the event listener I only call session.save(). I don't
>> call close or logout.
>> While changing of property over POST servlet is calling session.save() ?
> If you register the observation listener with the session of the
> request, it will most likely be lost immediately after the request is
> done, as Sling's session pool (is it still active?) will log out the
> session. For observation listeners you should have a OSGi service that
> creates its own session for the event listener and keeps that session
> open as long as the component is active. Often you want an
> administrative session which you can get with an scr reference to the
> SlingRepository and call loginAdministrative() on that.
> BTW, you don't need to call save after registering the event listener
> - save is only there to persist changes in nodes or properties.
> Regards,
> Alex

View raw message