Sudheer Prem created SOLR-4561:
----------------------------------

             Summary: 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


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;
    }  

--
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: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to