These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Caching collections with filters enabled
PostPosted: Thu Oct 25, 2007 9:19 pm 
Newbie

Joined: Thu Oct 25, 2007 8:37 pm
Posts: 1
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


Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 25, 2007 10:47 pm 
Hibernate Team
Hibernate Team

Joined: Tue Jun 13, 2006 11:29 pm
Posts: 315
Location: Calgary, Alberta, Canada
To get started on the NHibernate source code, you may have a look here:
http://www.hibernate.org/428.html

To port a Java feature, I would suggest checking out the Hibernate trunk and port over the related tests first. Assuming that you are not familiar with the neither the Hibernate or NHibernate code base, you may have to debug Hibernate and NHibernate side-by-side to identify the differences. I personally use Eclipse for Hibernate, but I am sure any Java IDE would do.

There is a learning curve involved for sure, but it is not as steep as one might think. If you run into a brick wall, you can always ask questions on the NHibernate-Development mailing list. Provided that the questions are related to the development of NHibernate itself, one usually gets a response pretty quickly.

Hope this helps.

_________________
Karl Chu


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.