Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Duplicate
-
4.1
-
None
-
None
Description
When child entities are created and the child entity is provided with a parametrized query as below,
<entity name="x" query="select * from x"> <entity name="y" query="select * from y where xid=${x.id}" processor="CachedSqlEntityProcessor"> </entity> <entity>
the Entity Processor always return the result from the fist query even though the parameter is changed, It is happening because, EntityProcessorBase.getNext() method doesn't reset the query and rowIterator after calling DIHCacheSupport.getCacheData() method.
This can be fixed by changing the else block in getNext() method of EntityProcessorBase from
else { return cacheSupport.getCacheData(context, query, rowIterator); }
to the code mentioned below:
else { Map<String,Object> cacheData = cacheSupport.getCacheData(context, query, rowIterator); query = null; rowIterator = null; return cacheData; }
Update: But then, the caching doesn't seem to be working...
Attachments
Issue Links
- duplicates
-
SOLR-3857 DIH: SqlEntityProcessor with "simple" cache broken
- Resolved