Re: SpellChecker AlreadyClosedException issue

2009-04-14 Thread Chris Hostetter
: 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

Re: SpellChecker AlreadyClosedException issue

2009-04-10 Thread John Cherouvim
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

Re: SpellChecker AlreadyClosedException issue

2009-04-09 Thread Chris Hostetter
: 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

SpellChecker AlreadyClosedException issue

2009-04-02 Thread John Cherouvim
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