I've been playing with latest solrj. If I make one object per query, I still got a "Too Many open file" exception from java.net.SocketException (in a Linux environment); however by reusing the same CommonsHttpSolrServer object, in multi-thread fashion, I haven't got any exception so far, everything seems to work (I haven't done test on the consistency of results, however).
but Is CommonsHttpSolrServer thread-safe? Thanks, Walter Ryan McKinley wrote: > >> I could build one CommonsHttpSolrServer for each query, or I could build >> just one, put it in a singleton and reuse it. >> > > either way. Solrj uses MultiThreadedHttpConnectionManager. > >> >> SolrJ I'm using is dated 2007-09-24 (downloaded from hudson), httpclient >> libs used is 3.1 (the very one than came with that sorlj) >> > > Try with a nightly after Oct 5 and see what happens: > http://svn.apache.org/viewvc?view=rev&revision=582349 > > If that does not do it, we need to fix something. > > ryan >