Clear root Entity cache when entity is processed
------------------------------------------------

                 Key: SOLR-2313
                 URL: https://issues.apache.org/jira/browse/SOLR-2313
             Project: Solr
          Issue Type: Improvement
          Components: contrib - DataImportHandler
    Affects Versions: 1.4.1
         Environment: Linux, JDBC, Postgres 8.4.6
            Reporter: Shane


The current process clears the entity caches once all root entity elements have 
been imported.  When a config file has dozens of root entities, the result is 
one "idle in transaction" process for each entity processed, effectively eating 
up the databases available connections.  The simple solution would be to clear 
a root entity's cache once that entity has been processed.

The following is a diff that I used in my instance to clear the cache when the 
entity completed:

--- DocBuilder.java     2011-01-12 10:05:58.000000000 -0700
+++ DocBuilder.java.new 2011-01-12 10:05:31.000000000 -0700
@@ -435,6 +435,9 @@
         writer.log(SolrWriter.END_ENTITY, null, null);
       }
       entityProcessor.destroy();
+                       if(entity.isDocRoot) {
+                               entity.clearCache();
+                       }
     }
   }


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to