: However, they may be something with the fact that Lucene's Analyzers
: automatically close the reader when its done analyzing. I think this
: encourages people not to explicitly close them, and creates the potential of
: having open fd's if an exception is thrown in the middle of the analysis or
: before addDocument/updateDocument is called.

It's always been the case that users should close their own Readers -- 
lucene's docs have never indicated that they will close hte reader for 
you, it's just a helpful side effect that once IndexWRiter has consumed 
all hte chars from a Reader it calls close() -- the caller should still 
close() explicitly for precisely the reasons you listed, but there's 
really no downside to multiple close calls.

even if we werent' worried about breaking existing client code (where 
people never call close themselves) it would still be a good idea to leave 
the close() calls in because the sooner the Readers are closed the sooner 
the descriptor can be released -- no reason to wait (ie: during a 
serialized merge for example) until addDocument is done if hte Reader has 
been completley exhausted.


-Hoss


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: java-dev-h...@lucene.apache.org

Reply via email to