I have removed most of the file to protect the innocent.   As you can see we 
have a high level item that has subentity called skus, and then those skus 
contain subentities for size/width/etc.  The database is configured for only 10 
open cursors, and voila, when the 11th item is being processed we get an 
exception from Oracle about violating the max open cursors.

<dataSource jndiName="java:/ds" type="JdbcDataSource" user="" password="" 
autoCommit="true" holdability="CLOSE_CURSORS_AT_COMMIT" 
transactionIsolation="TRANSACTION_READ_COMMITTED"/>
    <document>
        <entity name="item"
            query="... where IS_VISIBLE != '0' and ACTIVE != '0' and 
STOCK_LEVEL != 0"
            transformer="LogTransformer" logLevel="debug" logTemplate="The 
product is ${item.DISPLAY_NAME} ${item.PRODUCT_ID}">

            <field column="PRODUCT_ID" name="id" />
            <field column="DISPLAY_NAME" name="name" />

            <entity name="sku"
                query="... where '${item.PRODUCT_ID}'"
                transformer="LogTransformer" logLevel="debug" logTemplate="The 
sku for product ${item.PRODUCT_ID} is ${sku.SKU_ID}">
                <field column="SKU_ID" name="sku" />
                <field column="DIMENSION_ID" name="width" />
                <field column="SIZE_ID" name="size" />
              <entity name="size"  
cacheImpl="org.apache.solr.handler.dataimport.SortedMapBackedCache" 
cacheLookup="${sku.COLOR_FAMILY_ID}"
                    query="...where SIZE_ID = '${sku.SIZE_ID}'"
                    transformer="LogTransformer" logLevel="debug" 
logTemplate="The size for product ${item.PRODUCT_ID} is ${size.SIZE_CODE}">
                    <field column="SIZE_CODE" name="sizeName" />
                </entity>
                <entity name="width" 
cacheImpl="org.apache.solr.handler.dataimport.SortedMapBackedCache"  
cacheLookup="${sku.DIMENSION_ID}"
                    query="...where DIMENSION_ID = '${sku.DIMENSION_ID}'"
                    transformer="LogTransformer" logLevel="debug"
                    logTemplate="The width for product ${item.PRODUCT_ID} is 
${width.DISPLAY_NAME}">
                    <field column="DISPLAY_NAME" name="widthName" />
                </entity>
          </entity>
        </entity>
    </document>
</dataConfig>


It seems like EntityProcessorBase should set the rowIterator and query to null 
after fetching the cached data.

protected Map<String, Object> getNext() {
    if(cacheSupport==null) {
...
    } else  {
      Map<String, Object> next = cacheSupport.getCacheData(context, query, 
rowIterator);
      query = null;
      rowIterator = null;
      return next;
    }
  }

Cheers,
Keith Naas
614-238-4139

Reply via email to