You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by Matej Knopp <ma...@gmail.com> on 2008/07/13 00:06:57 UTC

Event notifications after session.logout()

Hi,

Can anyone explain me why the event observation listeners are removed
in session.logout()? I don't remember the specs saying anything about
this. I have looked at JCR-798 but i still don't understand where the
problem is. EventListener doesn't get reference to session or actual
nodes so unless user provides one (which he should be aware of) I
don't see how there can be session internals conflicts.

The current solution of removing the listeners is very unfortunate as
the only way to have background listeners is to keep session opened
for every workspace. We have lot of workspaces and since each session
holds database connection opened this is a no go.

Am I missing something important here?

I really don't get why the listeners are removed on session.logout
when they are scoped by the workspace.

Kind regards,
Matej

Re: Event notifications after session.logout()

Posted by Matej Knopp <ma...@gmail.com>.
Hi,

I'm sorry, looks like I missed Event#getPath() namespace translation.

But if the listeners really are tied to the session then the API is
quit confusing as
a) the observation manager is obtained from workspace
b) i don't recall either jsr 170 or the jcr api mentioned anything
about unregistering events on session logout.

Also, would it be a performance problem leaving a session for each
workspace opened to get the proper notifications? There could be
hundreds of sessions opened for each node, but the sessions would be
quite idle and shouldn't hold any transient data.

Kind regards,
-Matej

On Sun, Jul 13, 2008 at 12:29 AM, Jukka Zitting <ju...@gmail.com> wrote:
> Hi,
>
> On Sun, Jul 13, 2008 at 1:06 AM, Matej Knopp <ma...@gmail.com> wrote:
>> Can anyone explain me why the event observation listeners are removed
>> in session.logout()?
>
> Because they were registered within the scope of that session, and are
> tied to the access credentials and namespace mappings associated with
> that session.
>
> BR,
>
> Jukka Zitting
>

Re: Event notifications after session.logout()

Posted by Jukka Zitting <ju...@gmail.com>.
Hi,

On Sun, Jul 13, 2008 at 1:06 AM, Matej Knopp <ma...@gmail.com> wrote:
> Can anyone explain me why the event observation listeners are removed
> in session.logout()?

Because they were registered within the scope of that session, and are
tied to the access credentials and namespace mappings associated with
that session.

BR,

Jukka Zitting

Re: Event notifications after session.logout()

Posted by Matej Knopp <ma...@gmail.com>.
Actually, looking at BundleDbPersistenceManager the connection
shouldn't be blocked by the session, yet I had postgresql complaining
about it. The problem might be somewhere else though.

-Matej

On Sun, Jul 13, 2008 at 12:06 AM, Matej Knopp <ma...@gmail.com> wrote:
> Hi,
>
> Can anyone explain me why the event observation listeners are removed
> in session.logout()? I don't remember the specs saying anything about
> this. I have looked at JCR-798 but i still don't understand where the
> problem is. EventListener doesn't get reference to session or actual
> nodes so unless user provides one (which he should be aware of) I
> don't see how there can be session internals conflicts.
>
> The current solution of removing the listeners is very unfortunate as
> the only way to have background listeners is to keep session opened
> for every workspace. We have lot of workspaces and since each session
> holds database connection opened this is a no go.
>
> Am I missing something important here?
>
> I really don't get why the listeners are removed on session.logout
> when they are scoped by the workspace.
>
> Kind regards,
> Matej
>