Hi,
By design, NHibernate doesn't (second level-)cache collections that have filters enabled and I think I understand the difficulties this would cause.
But I noticed a comment in the java version that suggests this might be a possibility by including filter info in the cache key. Do you think this is feasible? Would it be a difficult change? I'd love to contribute but would need a lot of help.
log.debug( "Refusing to add to cache due to enabled filters" );
// todo : add the notion of enabled filters to the CacheKey to differentiate filtered collections from non-filtered;
// but CacheKey is currently used for both collections and entities; would ideally need to define two seperate ones;
// currently this works in conjuction with the check on
// DefaultInitializeCollectionEventHandler.initializeCollectionFromCache() (which makes sure to not read from
// cache with enabled filters).
If this change isn't feasible or isn't on the radar, do you have any suggestions for caching a subset of data in a one-to-many relationship, specifically with temporal data. I really need the flexibility to shift date perspective, but still get the performance benefits of caching.
Thanks a bunch.
Matt
matt_cameron@invesco.com