jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alexander Klimetschek <aklim...@day.com>
Subject Re: eventListener doesn't work
Date Sun, 15 Mar 2009 20:59:26 GMT
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

-- 
Alexander Klimetschek
alexander.klimetschek@day.com

Mime
View raw message