How to implement a full cache?

Posts   
 
    
Ries
User
Posts: 46
Joined: 23-Aug-2006
# Posted on: 23-Aug-2006 00:30:51   

Hi,

http://www.llblgen.com/tinyforum/Messages.aspx?ThreadID=6265&HighLight=1

Q: I know I can override the FetchEntity(), FetchEntityCollection(), FetchEntityWithUniqueConstraint(). This will work for direct fetch of an object put in cache. But it' ll not work if the same object is fetched via prefetch path.

Reply: Yes it will, as prefetch path fetches will use FetchEntityCollection to do the work

Can you elaborate a bit on this? If I were to override FetchEntity, and get the entity from a cache, how do I then return it from FetchEntity? I guess I need to populate the input parameter passed to the FetchEntity method somehow with the data from the entity retrieved from the cache.

Thanks, Ries

bclubb
User
Posts: 934
Joined: 12-Feb-2004
# Posted on: 23-Aug-2006 03:50:17   

You will want to override these methods using your own logic to lookup the entities in cache. It will then be depend on how you implemented your cache to determine if you have to rebuild your entities or if you are able to use actual entities stored in your cache.