cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrus Adamchik <and...@objectstyle.org>
Subject Re: Cayenne shared cache invalidation
Date Wed, 22 Aug 2012 13:09:36 GMT

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
Mime
View raw message