[gentle] Cache Questions
Brought to you by:
mnmr
From: Adam B. <ag...@gm...> - 2006-11-07 15:16:51
|
As I said, my application is swamped by the CacheManager.ClearQueryResultsByType method, so I'm digging through the cache code trying to get my head around it. What I don't understand is why ObjectFactory.GetCollection() adds items to the cache using ObjectMap.GetInstanceHashKey(object) as the key which is in the form of "Type|PK=X" while ObjectFactory.GetInstance() uses the SQLStatement.CacheKey which is in the form "Type|Query|Parameters". I ask because CacheManager.ClearQueryResultsByType will only remove entries of the second form and my log shows that I'm only getting cache hits for keys of the first form. So its seems like a naive way to get around this bottleneck would be to not have GetInstance() add to the cache and not have CacheManager.ClearQueryResultsByType run as there would nothing for it to clear out. Adam |