0 Replies Latest reply on Oct 27, 2004 7:15 AM by paulsmith001

    Cache invalidation of all entities programatically - possibl

    paulsmith001

      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!?

      Many thanks,
      Bob