jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <wikidi...@apache.org>
Subject [Jackrabbit Wiki] Update of "Clustering" by ThomasMueller
Date Tue, 30 Nov 2010 13:31:01 GMT
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Jackrabbit Wiki" for change notification.

The "Clustering" page has been changed by ThomasMueller.
The comment on this change is: document concurrent write behavior.
http://wiki.apache.org/jackrabbit/Clustering?action=diff&rev1=25&rev2=26

--------------------------------------------------

  
  All cluster nodes must point to the same data store location. The data store should be used
to store large binaries (all cluster nodes need to access the same data store). When not using
the data store, one need to set the parameter '''externalBLOBs''' to ''false'' so that large
binaries are stored in the persistence manager. The file system blob store does not support
clustering, because it uses a local directory.
  
+ == Concurrent Write Behavior ==
+ 
+ When multiple cluster nodes write to the same nodes, those nodes must be locked first. If
the nodes are not locked, then the operation may fail if the nodes were updated concurrently
(or a little bit earlier). As an example, the following sequence may fail on session 2 (session
1 operates on cluster node 1, session 2 on cluster node 2), even the operations on session
2 are executed after session1.save():
+ 
+ {{{
+ // on cluster node 1
+ session1.getRootNode().getNode("test").setProperty("x", "a");
+ session1.save();
+ // on cluster node 2
+ session2.getRootNode().getNode("test").setProperty("x", "b");
+ session2.save();
+ }}}
+ 
+ The best solution is to use locking. If session2 operations are guaranteed to be executed
after all session1 operations, another solution is to use session.refresh(), however only
if cluster sync in refresh is enabled:
+ 
+ {{{
+ // on cluster node 1
+ session1.getRootNode().getNode("test").setProperty("x", "a");
+ session1.save();
+ // on cluster node 2
+ session2.refresh(false);
+ session2.getRootNode().getNode("test").setProperty("x", "b");
+ session2.save();
+ }}}
+ 

Mime
View raw message