On Aug 22, 2012, at 4:04 PM, Andrus Adamchik wrote:

>> private void clearCache(Object entity) {
>>      Persistent object = (Persistent)entity;
>>      QueryCache cache = 
>> ((BaseContext)object.getObjectContext()).getQueryCache();
>>      cache.removeGroup(object.getClass().getName());
>> }
> 
> This is going in the right direction. So is listener method invoked, but the 
> cache is not cleared, or the listener method is never invoked. 

BTW, could it be that the cache you are invalidating is a local cache? IIRC 
before Cayenne 3.1 this would not propagate to the shared cache (it will in 
3.1). So you'd need to access QueryCache of DataDomain, which is the shared 
cache.

Andrus

Reply via email to