I currently have a Seam component which is in my session. This component is
holding a custom “Lucene object” (private attribute) which opens a Lucene
index in the constructor. When I want to search, I use the “Lucene object”
in my session which uses the already opened Lucene index.
So when I want to search on something else, I can still reuse the already
opened index.
But now, I don’t have some Java logic which closes the reader. Shouldn’t
this be done in some method like the destroy() method (which is called by
te JVM)?
Or is it ok if I don’t manually close the reader?
Thanks,
Jochen
You should never keep a lucene reader open for longer than the length of the thread. Not closing up those readers will make you run into problems with your OS. (you run out of file locks)