简体   繁体   English

lucene中的回滚

[英]Rollback in lucene

Is there a rollback in lucene? lucene有回滚吗?

I'm saving & updating database repository & lucene repository simultaneously so that the lucene index & database are in sync.. 我要同时保存和更新数据库存储库和lucene存储库,以使Lucene索引和数据库保持同步。

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 . 我不确定您如何使用Lucene或C#版本与Java版本有什么不同,但是至少Java中的IndexWriter包含commitrollback方法。 If you could post some implementation code that would probably help. 如果您可以发布一些实现代码可能会有所帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM