Rollback in lucene
Is there a rollback in lucene?
I'm saving &开发者_StackOverflow社区 updating database repository & lucene repository simultaneously so that the lucene index & database are in sync..
ex.
CustomerRepository.add(customer); SupplierRepository.add(supplier); CustomerLuceneRepository.add(customer); SupplierLuceneRepository.add(supplier); // If this here fails i cannot rollback the customer above DataContext.SubmitChanges();
I am not completely sure on how you are using Lucene or how the C# version differs from the Java version, but at least IndexWriter
in Java contains methods for commit
and rollback
. If you could post some implementation code that would probably help.
精彩评论