> From: Matt Tucker [mailto:[EMAIL PROTECTED]] > > I'd like to > suggest that it might help to add some comments to the Javadocs of > IndexReader and IndexWriter about when directories are locked and what > it means.
In short, an IndexWriter locks an index so that other IndexWriters cannot be opened on the same index. This is the "write.lock" file. The IndexWriter also locks the "commit.lock" file while it is installing a new version of the index, and trying to delete files related to the old version. An IndexReader also grabs the "commit.lock" while it is opening the index, so that an IndexWriter doesn't try to delete files before it has a chance to open all of them. (Now we just need to get this into the documentation...) > Second, is there a particular exception I can catch when > trying to open a directory to handle if a lock is already on that dir? > Would it make sense to add a DirectoryLockedException or something > similar? Currently an IOException is thrown with a message indicating the problem. Would your application be better served by a subclass of IOException? Doug -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
