Hi.,
I am working on cache management. while updating ProductPrice(supposed entity) for one product, whole entity-list cache for ProductPrice("entitycache.entity-list.default.ProductPrice") was getting cleared. i.e, if my 20K product Prices were cached at some time point , if I updated price for one product, all the ProductPrice entity-list cache was getting cleared. While looking this problem, I am suspecting some code in * AbstractEntityConditionCache.java*<http://svn.apache.org/repos/asf/ofbiz/branches/release09.04/framework/entity/src/org/ofbiz/entity/cache/AbstractEntityConditionCache.java>storeHook() method, // QUESTION: what is this? why would we do this? if (!oldMatched && isPK) { //Debug.logInfo("In storeHook, for entityName [" + entityName + "] oldMatched is false and isPK is true, so setting shouldRemove to true (will remove from cache)", module); Debug.logInfo("shouldRemove made as true.....for oldMatched", module); shouldRemove = true; } This code block was playing role to clear all the entity-list cache for a perticular entity. Surprisingly, I find some question was asking for this block(commented code above this block.) * *My Question was*: 1) Can anybody please update me is there any other reason why we need to cache-clear for entire entity-list cache for that entity if suppose I changed for one *GenericValue??. *2) If there is no purpose for this code block, Why we need this?* ** -- Thanks, Kumaraswamy.N 91-9866805250. |
Am I not clear regarding this question??
On Tue, Feb 16, 2010 at 3:02 PM, Kumaraswamy nandipati < [hidden email]> wrote: > Hi., > > I am working on cache management. while updating ProductPrice(supposed > entity) for one product, whole entity-list cache for > ProductPrice("entitycache.entity-list.default.ProductPrice") was getting > cleared. i.e, if my 20K product Prices were cached at some time point , if I > updated price for one product, all the ProductPrice entity-list cache was > getting cleared. While looking this problem, I am suspecting some code in > *AbstractEntityConditionCache.java*<http://svn.apache.org/repos/asf/ofbiz/branches/release09.04/framework/entity/src/org/ofbiz/entity/cache/AbstractEntityConditionCache.java>storeHook() method, > > // QUESTION: what is this? why would we do this? > if (!oldMatched && isPK) { > //Debug.logInfo("In storeHook, for entityName [" + > entityName + "] oldMatched is false and isPK is true, so setting > shouldRemove to true (will remove from cache)", module); > Debug.logInfo("shouldRemove made as true.....for > oldMatched", module); > shouldRemove = true; > } > > > This code block was playing role to clear all the entity-list cache for a > perticular entity. Surprisingly, I find some question was asking for this > block(commented code above this block.) > * > *My Question was*: > 1) Can anybody please update me is there any other reason why we need to > cache-clear for entire entity-list cache for that entity if suppose I > changed for one *GenericValue??. > > *2) If there is no purpose for this code block, Why we need this?* > > ** > > > > -- > Thanks, > Kumaraswamy.N > 91-9866805250. > -- Thanks, Kumaraswamy.N 91-9866805250. |
Free forum by Nabble | Edit this page |