[jboss-user] [JBoss Cache: Core Edition] - Re: Strange invalidation

bstansberry@jboss.com do-not-reply at jboss.com
Mon Nov 24 14:42:37 EST 2008


The trick to having the same info stored in multiple nodes while using invalidation is to have logic to differentiate two types of writes to the cache.  Here I'll use terminology from Hibernate's Second Level Caching implementation, which faces this exact problem:

1) A "put".  This is a write to JBC of data that's stored elsewhere in a "master" source (e.g. a database) and is unchanged from that master source. Storing this in JBC shouldn't invalidate other nodes, since other nodes will also have the same data from the same "master" source.

To make this kind of write to JBC, use the JBC putForExternalRead() method.

2) An "insert/update".  Here the application is changing the master data and needs to make the cache aware of the change. Since other nodes in the cluster may also have now out-of-date copies of the data cached, they need to be invalidated.

To make this kind of write to JBC, use the JBC put() method.

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4191863#4191863

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4191863



More information about the jboss-user mailing list