jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marcel Reutegger <marcel.reuteg...@gmx.net>
Subject Re: Synchronized methods in ItemManager
Date Mon, 17 Sep 2007 07:49:10 GMT
> I should have explained my question in more detail. The Javadoc of the
> ItemManager states that there's one ItemManager per Session: it is
> created in the constructor of SessionImpl. Sessions are not thread-safe
> by specification. Because some methods in the ItemManager are
> synchronized, an ItemManager instance of a Sesssion can also be accessed
> by other threads than the one that is using the Session that created
> that ItemManager. I am just wondering when that could happen.

our official statement still is you may use multiple threads on a session that 
just read but a single thread on a session that writes. in addition there's also 
the scenario where one thread saves changes on session and those changes get 
propagated to other sessions that are accessed by other threads.

as for multiple threads on a single session instance I personally prefer a more 
coarse grained synchronization to avoid monitor contention. see: JCR-890.

regards
  marcel

Mime
View raw message