On Feb 16, 2009, at 15:06, Sanne Grinovero wrote:
to solve HSEARCH-284 (Lucene locks left around in application
I am investigating the differences in all Lucene's LockFactory
some of them are interesting and I would like to add a configuration
replace the default one in Hibernate Search.
1) property name:
I'm naming the property key "locking_strategy", scoped for each
At first I was planning to use the usual design to be able to specify
by specifying the qualified class name, but actually only 4
implementations make sense
and if someone really needed the flexibility to implement their own
they can define
their own DirectoryProvider and use whatever they want.
hum, does that makes our codebase more complex to support custom
LockFactories? I would like this flexibility/
Also 2 of the base Lucene implementations are missing a public no-args
so I would use only simple names:
simple -> org.apache.lucene.store.SimpleFSLockFactory
native -> org.apache.lucene.store.NativeFSLockFactory
single -> org.apache.lucene.store.SingleInstanceLockFactory
none -> org.apache.lucene.store.NoLockFactory
yes, simple names for those that make sense and fqcn for the others.
We might also support a "factory" so that impl wo no-arg constructor
can be used, but that's an enhancement we can do later if needed.
3) support for "none":
I don't think we should let the user select something which is not
with H.Searche's design, so I am still trying to figure out if the
could be an option in case Search is the only process accessing the
Currently inside search the IndexReaders/Searchers are read-only,
and at most
one IndexWriter is using the DP, so the locking strategy could be set
to "none" IMHO.
that sounds reasonable but how does that differ from
The current default is "simple", which has the problem as reported in
so I was puzzled by the idea to define the "native" as the default
one to have
Search beginners avoid the locking problem, but I am hitting some
problems under load testing,
so I think the default should stay to "simple" at least for now.