jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alexander Klimetschek" <aklim...@day.com>
Subject Re: Session Closed in Event Listener
Date Wed, 26 Nov 2008 00:06:50 GMT
On Tue, Nov 25, 2008 at 11:31 PM, majohnst <matt@lattaoutdoors.com> wrote:
> I am using Jackrabbit through Spring 2.5.6. I registered an event listener
> that will tell a spring bean about the changes to my node. When the bean
> gets the call, I try to navigate through the repository using the path from
> the event. I am unable to do this because I get an error that the session is
> already closed. I pretty much understand why the session is closed because
> the event is called after all the changes have been made.
>
> So my question is how I can get a new jcr session in my spring bean? Am I
> going to have to use something like JMS to start a new thread?

No, you have to make sure the session in which the eventlistener was
registered, stays open as long as the eventlistener should be active.
It might be that some of the Spring "magic" closes the session right
after the eventlistener was registered, which will fail.

With JCR it is generally better to directly access the api and avoid
any Spring templates, background-wiring or DAO wrappers...

Regards,
Alex

-- 
Alexander Klimetschek
alexander.klimetschek@day.com

Mime
View raw message