Cache Invalidation

The example below shows how to invalidate a cache entry in code running in a transactional context (server code). As explained in Default Global Cache Group , cache invalidation for global caches in the default cache group can only be triggered by server code.

Figure 1. Invalidating a cache entry in server code
...
CacheManagerEjb.postInvalidationMessage(
          new CacheInvalidationMessage<Key>("mycache", 1));
...