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.