Hey everyone, I've configured a distributed Infinispan cache in JBoss EAP 6.3.0GA
The configuration looks as follows:
<cache-container name="modeshape" aliases="modeshape modeshape-cluster" default-cache="sample" start="EAGER" module="org.modeshape" statistics-enabled="false">
<distributed-cache name="sample" owners="1" mode="SYNC" start="EAGER" statistics-enabled="false">
<transaction mode="NON_XA" locking="PESSIMISTIC"/>
<string-keyed-jdbc-store datasource="java:/jdbc/oracle" shared="true" passivation="false" purge="false">
<id-column name="ID_COLUMN" type="VARCHAR2(512)"/>
<data-column name="DATA_COLUMN" type="BLOB"/>
<timestamp-column name="TIMESTAMP_COLUMN" type="NUMBER"/>
ModeShape is using this cache to store its information in. I've setup two machines with the same configuration and they are clustering properly with JGroups, changes made on one machine are seen on the other and vice versa.
However, when iterating through all nodes in Modeshape (thus retrieving data from Infinispan) on machine A, I would expect all this to be seen by machine B, i.e. Infinispan on machine B will retrieve the information from A, instead of going to the string-keyed-jdbc-store. This is not the case however, when iterating through all nodes on machine B, it takes just as long as it did on A. When I monitor the memory using VisualVM, I see it growing only after iterating through all nodes, and the amount of data loaded is the same on both A and B.
Is this expected behaviour?
Yes, it should work. However I'm not entirely familiar with how ModeShape interacts with Infinispan, so I'd refer you to the ModeShape guys.