Donovan, Aaron wrote:
In anticipation of an upcoming 2.1 release, I started testing the
Berkeley Database - Java Edition Directory implementation. I
immediately received a NullPointerException while trying to create an
index. It was a result of the getLockFactory() returning null.
What is the new responsibility of Directory implementations regarding a
LockFactory?
Should Directory return a donothing implementation by default?
- Both of the Berkeley implementations would benefit from this approach
because the database handles locks.
Hmmm... the LockFactory implementation is supposed to be backwards
compatible to Directory implementations that define their own
makeLock(...) method.
In other words, subclasses of Directory should not need to use a
LockFactory at all if they want to continue to implement their own
locking instead.
Oh, I think I see what happened. Are you hitting NPE on this line in
IndexWriter?:
if (create) {
// Clear the write lock in case it's leftover:
directory.getLockFactory().clearLock(IndexWriter.WRITE_LOCK_NAME);
}
This is my bad ... sorry about that. This was part of my recent fix
for LUCENE-773. I will re-open that issue, add a unit test, and fix
this case. Thanks for catching it!
Mike
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]