Re: Multiple threads under tomcat

2009-11-10 Thread Erick Erickson
1) Should the "FSDirectory dir" object be shared as some sort of static variable? I don't think it matters, do the simplest thing. The overhead in creating an FSDirectory is so small in relation to the other operations that I don't think you'd ever notice. 2) Should the "IndexSearcher searcher" or

Multiple threads under tomcat

2009-11-10 Thread Jacob Rhoden
Apologies if this info is already somewhere, but google cant find it (: I am assuming the following code is completely thread safe: // Called from a servlet when a user action results in the index needing to be updated public static void rebuildIndex() { FSDirectory dir = new NIOFSDirecto