Minor tweaking

This commit is contained in:
Lassi Immonen 2010-12-28 21:45:00 +00:00
parent 948ff3835e
commit 1cc08c1455
3 changed files with 3 additions and 7 deletions

View File

@ -20,10 +20,6 @@ public class LuceneSearcher {
this.searcher = searcher;
}
public void close() {
release();
}
public boolean isCurrent() {
try {
return searcher.getIndexReader().isCurrent();

View File

@ -102,7 +102,7 @@ public class LuceneSessionFactoryImpl implements LuceneSessionFactory {
LuceneSearcher s = new LuceneSearcher(new IndexSearcher(directory));
if (!searcher.compareAndSet(expected, s)) {
// Some thread already created a new one so just close this
s.close();
s.release();
} else {
// Incrementing the reference count first time
// We want to keep using the same reader until the index is changed

View File

@ -72,7 +72,7 @@ public class LuceneSessionImpl implements LuceneSession {
if (searcher != null) {
try {
searcher.close();
searcher.release();
} catch (QueryException e) {
searcherException = e;
}
@ -100,7 +100,7 @@ public class LuceneSessionImpl implements LuceneSession {
writer.commit();
if (searcher != null) {
searcher.close();
searcher.release();
}
searcher = null;