1 of 1 people found this helpful
In 4.4.0 the only index provider you have if MapDB based. This in turn, if there's an unexpected failure and the VM is terminated abruptly has a very high chance of corrupting the indexes.
There are several changes in ModeShape 4.5.0.Final (http://docs.jboss.org/modeshape/4.5.0.Final/release.html) which can help mitigate this problem:
- use Lucene instead of MapDB (which should have better fault tolerance) and/or
- enable the local event journal and use incremental re-indexing (see release notes). Since the journal is also MapDB based, in case of an unexpected shutdown it may be corrupted as well, but none-the-less it's an option worth investigating.
4.5.0.Final also has some improvements to the LocalIndexProvider by adding VM shutdown hooks which commit the in-memory index information (however depending on how abrupt your termination is, shutdown hooks may not be invoked at all).
So my suggestion is first simply using 4.5.0.Final and see whether the shutdown hooks are enough for your case. If they're not, you should try one of the above options.