jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Conoly, Brett" <Brett.Con...@digitalinsight.com>
Subject RE: Event Listeners?
Date Wed, 21 May 2008 13:38:49 GMT
Using jackrabbit as our development repository we have had several
instances where the repository has thrown errors saying "No managed
connections available".  We've assumed that this means that we have been
starting processes and then killing them before they had a chance to
close their sessions.

If we have to hold a session just so that an event can fire that seems
like it would be just one more connection clogging up the pool.

We also have two conflicting issues if this is the case
1: does the session ever expire?
2: With the way our connections can become unavailable if we kill our
processes before we close our connections we probably will want the
sessions to expire after a certain amount of time to avoid the "No
managed connections available" error.

Also, I'm assuming that the EventListeners are just running on a
background thread just waiting to be notified of the change.

The way that I'm registering the event listener right now, I'm opening a
session and then closing it through a try...finally block.

When I close this session does it send a signal to this background
thread telling it to finish up, or is it just sitting in limbo?

And if I do have to keep a reference to a session for the life of the
repository and/or the event listener, is there a way that I can increase
the number of connections that the repository allows?

Thanks again,
Brett

-----Original Message-----
From: Jukka Zitting [mailto:jukka.zitting@gmail.com] 
Sent: Wednesday, May 21, 2008 9:20 AM
To: users@jackrabbit.apache.org
Subject: Re: Event Listeners?

Hi,

On Wed, May 21, 2008 at 3:51 PM, Conoly, Brett
<Brett.Conoly@digitalinsight.com> wrote:
> I have a singleton instance holding information retrieved from many
> files in the repository and I have an EventListener made to watch the
> files for any changes to those files.
>
> When a file is changed, the event listener gets an instance of the
> singleton and reloads the information in that file.
>
> I was told by someone in this forum a little while back that the
> EventListeners keep listening as long as the session is still active.
>
> This doesn't seem to make sense unless I just need to hold a reference
> to a session and never close it in order to get the Listener to work
> correctly???

What's wrong with such a session?

> Is there any way to register an EventListener for the life of the
> repository, for a single workspace, or anything else?

You can create a "listener session" just for that purpose.

BR,

Jukka Zitting

Mime
View raw message