we learned it hard way, Wish I had read this
before http://wiki.apache.org/solr/EmbeddedSolr it is not threadsafe. start seeing concurrent modification exception as soon as within 100 Samples, when you load it with more than 1 Concurrent Users ( I have tested it using jmeter) best, Reuben On 12/9/2009 12:47 PM, Jon Poulton wrote: Hi there, I'm about to start implementing some code which will access a Solr instance via a ThreadPool concurrently. I've been looking at the solrj API docs ( particularly http://lucene.apache.org/solr/api/index.html?org/apache/solr/client/solrj/embedded/EmbeddedSolrServer.html ) and I just want to make sure what I have in mind makes sense. The Javadoc is a bit sparse, so I thought I'd ask a couple of questions here.1) I'm assuming that EmbeddedSolrServer can be accessed concurrently by several threads at once for add, delete and query operations (on the SolrServer parent interface). Is that right? I don't have to enforce single-threaded access? 2) What happens if multiple threads simultaneously call commit? 3) What happens if multiple threads simultaneously call optimize? 4) Both commit and optimise have optional parameters called "waitFlush" and "waitSearcher". These are undocumented in the Javadoc. What do they signify? Thanks in advance for any help. Cheers Jon --
![]() |