jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Vidar Ramdal <vi...@idium.no>
Subject Re: Is an ObservationManager safe to use across threads?
Date Fri, 15 Oct 2010 12:02:27 GMT
> On Fri, Oct 15, 2010 at 11:46, Vidar Ramdal <vidar@idium.no> wrote:
>> Is this safe, or is the ObservationManager retrieved by
>> session.getWorkspace().getObservationManager() tied to the session
>> from which it was acquired?

On Fri, Oct 15, 2010 at 12:17 PM, Ian Boston <ieb@tfd.co.uk> wrote:
> In general its not safe since the session the observation manager was created with
> (which must stay logged in for the ObservationManager to remain active) is stored internally
and used
> internally. There is one point where a check is made to ensure the same session is connected
to dispatches,

On Fri, Oct 15, 2010 at 12:18 PM, Alexander Klimetschek
<aklimets@day.com> wrote:
> Yes, it is session-specific (getWorkspace() is also a session-specific
> instance). So there is no guarantee that it works in multiple threads.

Guys, thanks for your explanations!

It is probably no surprise that I'm implementing a cache to hold some
data fetched from JCR, and that the cache should invalidate items if
they are modified (by listenting to events).

I now see that this will be messy, with a worker thread doing the JCR
stuff, and who knows what else. If anyone has pointers to best
practices/examples/experiences on anything like this, I will greatly
appreciate it.

-- 
Vidar S. Ramdal <vidar@idium.no> - http://www.idium.no
Sommerrogata 13-15, N-0255 Oslo, Norway
+ 47 22 00 84 00 / +47 22 00 84 76
Quando omni flunkus moritatus!

Mime
View raw message