[ https://issues.apache.org/jira/browse/SOLR-4561?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13599868#comment-13599868 ]
Ahmet Arslan commented on SOLR-4561: ------------------------------------ I ran into this bug too. > CachedSqlEntityProcessor with parametarized query is broken > ----------------------------------------------------------- > > Key: SOLR-4561 > URL: https://issues.apache.org/jira/browse/SOLR-4561 > Project: Solr > Issue Type: Bug > Components: contrib - DataImportHandler > Affects Versions: 4.1 > Reporter: Sudheer Prem > Original Estimate: 1m > Remaining Estimate: 1m > > When child entities are created and the child entity is provided with a > parametrized query as below, > {code:xml} > <entity name="x" query="select * from x"> > <entity name="y" query="select * from y where xid=${x.id}" > processor="CachedSqlEntityProcessor"> > </entity> > <entity> > {code} > 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 > {code} > else { > return cacheSupport.getCacheData(context, query, rowIterator); > > } > {code} > to the code mentioned below: > {code} > else { > Map<String,Object> cacheData = cacheSupport.getCacheData(context, > query, rowIterator); > query = null; > rowIterator = null; > return cacheData; > } > {code} > Update: But then, the caching doesn't seem to be working... -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org