I have 2 laptops and and i started hotrod server on Node1.
From the other system(which is in the same network), i did the following..
RemoteCacheManager rm = new RemoteCacheManager("node1ip", port);
RemoteCache<string, Student> rcache =rm.getCache("studentCache");
Student st = rcache.getStudent(string);
If i have the same jar(containing Student class) in classpath of node2, will this work?
If this works,
Will, changing the property of Student in node2, will also update the remote cache?
So, its not like in local cache? in local cache, i do not need to do cache.put(k,v) . Probably value will be stored as a reference. So, if we do the below, it will update the object in the cache..
Book b = cache.get("key");
and if i do cache.get("key") now, i will get the updated book object..
So, my doubt is, does this hold good in remote cache also??
On the local node Infinispan does not copy the inserted objects and keeps a reference to the original object instead (unless you enable storeAsBinary). So all the changes made to those objects are automatically visible in the cache, but that is just an accidental effect of how Infinispan stores values - there isn't any effort to track changes to your objects and update the values in the cache.
The remote nodes obviously can't hold a reference to your objects, so they won't see any changes this way. The old JBossCache project had a "POJO Edition" that would track changes to objects and automaticall update the copies on all the cluster nodes, but it hasn't been ported to Infinispan.