: dir is a local variable inside a method, so it's not getting reused.
: Should I synchronise the whole method? I think that would slow things down in
: a concurrent environment.
i don't really have any new advice beyond my previous comment...
: > if you have a fully exeuctable test case (instea
dir is a local variable inside a method, so it's not getting reused.
Should I synchronise the whole method? I think that would slow things
down in a concurrent environment.
Thanks for your response.
Chris Hostetter wrote:
: My code looks like this:
:
: Directory dir = null;
: try {
:di
: My code looks like this:
:
: Directory dir = null;
: try {
:dir = FSDirectory.getDirectory("/path/to/dictionary");
:SpellChecker spell = new SpellChecker(dir); // exception thrown here
:// ...
:dir.close();
: This code works, but in a highly concurrent situation AlreadyClosedEx
Hello
My code looks like this:
Directory dir = null;
try {
dir = FSDirectory.getDirectory("/path/to/dictionary");
SpellChecker spell = new SpellChecker(dir); // exception thrown here
// ...
dir.close();
} catch (IOException ex) {
log error
} finally {
if (dir!=null) {
tr