Return-Path: Delivered-To: apmail-jackrabbit-dev-archive@www.apache.org Received: (qmail 62235 invoked from network); 16 Mar 2009 09:45:06 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 16 Mar 2009 09:45:06 -0000 Received: (qmail 38605 invoked by uid 500); 16 Mar 2009 09:45:05 -0000 Delivered-To: apmail-jackrabbit-dev-archive@jackrabbit.apache.org Received: (qmail 38568 invoked by uid 500); 16 Mar 2009 09:45:05 -0000 Mailing-List: contact dev-help@jackrabbit.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@jackrabbit.apache.org Delivered-To: mailing list dev@jackrabbit.apache.org Received: (qmail 38559 invoked by uid 99); 16 Mar 2009 09:45:05 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 16 Mar 2009 02:45:05 -0700 X-ASF-Spam-Status: No, hits=1.2 required=10.0 tests=SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: 195.39.10.3 is neither permitted nor denied by domain of vkrejcirik@gmail.com) Received: from [195.39.10.3] (HELO mail.fofrnet.cz) (195.39.10.3) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 16 Mar 2009 09:44:55 +0000 Received: from [192.168.36.12] (obec-hlusovice.fofrnet.net [77.48.132.130]) by mail.fofrnet.cz (Postfix) with ESMTP id 82DE677C8 for ; Mon, 16 Mar 2009 10:49:30 +0100 (CET) Message-ID: <49BE1F80.3010303@gmail.com> Date: Mon, 16 Mar 2009 10:44:32 +0100 From: vkrejcirik User-Agent: Thunderbird 2.0.0.12 (Windows/20080213) MIME-Version: 1.0 To: dev@jackrabbit.apache.org Subject: Re: eventListener doesn't work References: <49B55E4C.70405@gmail.com> <49BD258E.6010803@gmail.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Virus-Checked: Checked by ClamAV on apache.org 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 http://www.vkrejcirik.info Alexander Klimetschek napsal(a): > On Sun, Mar 15, 2009 at 4:58 PM, vkrejcirik 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 > >