This is not a clustering question, it's a cache invalidation question. And although the two usually go hand in hand, they do not necessarily do so. But this does seem to be a place where experienced Cache Invalidation Framework experts hang out. So, any CIF experts out there then please help!!!
I want to invalidate all instances of all entities from the container's cache programatically.
In the deployment descriptor of all my entity beans I will set cache-invalidation to false. I will do this because I do not want to invalidate entities on transaction commits (i.e. when an RW entity has changed in a container). This is not a clustering issue. I do not want the InvalidationManager to automatically inform containers' caches to invalidate an entity. I need to do that myself at a particular point in time. I could prevent the automatic invalidation in two ways -
1. set cache-invalidation to false
2. deploy the entities to a container that does not have the EntityBeanCacheBatchInvalidatorInterceptor interceptor configured.
Either one of the above should achieve the same effect. I have chosen the first.
I have written the code to invoke the batchInvalidation method on the InvalidationManager mbean. However, I need to supply keys and a group name. I could configure all my entity beans to have the same invalidation-group-name, but what do I supply for the keys? I want to evict all entities from the cache. I kinda want to say "*".
Even if I was to supply keys, what confuses me is that if I have two entity bean classes - Customer and Order say - and configure each to have the same invalidation group name, then if I supply keys 001 and 003 to the InvalidationManager, how does it know that key 001 is for a Customer and key 003 is an Order!?