lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul Taylor <paul_t...@fastmail.fm>
Subject Closing indexsearcher , making sur eit is in use
Date Thu, 13 Jan 2011 20:21:50 GMT
As recommended, I use just one Index Searcher on my multithreaded GUI 
app using a singleton pattern
If data is modified in the index I then close the reader and searcher, 
and they will be recreate on next call to getInstance() but Ive hit a 
problem whereby one thread was closing a searcher, another thread 
already the searcher open but when came to use it gave exception 'the 
IndexReader is closed'

I obviously dont want access to the searcher to be synchronized as it is 
designed to work multithreaded, so how should I close it safetly, i.e 
close if no current references to it.

Paul

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Mime
View raw message