You should add the attribute shared=true to the string-keyed-jdbc-store element. Notice you have to do itfor all cluster members!
This configure your jdbc store to be aware that there are multiple instances.
They are two different nodes with a local database in each node. The shared attribute is used when the two nodes are using the same database. Not the case. But, thanks for answering. Is there anything that I could do to solve this problem?
Well, when I increase max-entries of <eviction/> it works! But, I have no idea why it could happen. It seems like eviction has something to do with the replication issue. Is there a explanation for this?
Thanks in advance again.
Well, I found out that the fetch-state should be true if you want Infinispan to fetch data from local store to replicate to the others clusters. Setting this prop as true everything works. That's why when I did set high max-entries it worked. Because Infinispan replicated data from memory cache, not from the local store.
I did not understand why you have two local datasources and a clustered cache. I suppose in that case you will have different results depending on what node is started.
So I don't understand the sense behind.
That's simple: I have two machines. I need to address high availability, so, I cannot have only one shared database. Every one will have its own local cache store. I tested it in several ways, if I use a low max-entries on eviction, I lose data when Infinispan replicate the stored cache to a new node. I mean, if I insert 100 new registers, when I add a new node only 94 registers are replicated to it. If I try to use with no eviction (max-entries="-1") it worked fine, but, I cannot have all data on memory or else I'd get an OutOfMemoryError. I tried to use Infinispan 5.3 and it did not happen, everything worked fine. Even using low max-entries. (what makes more sense).