1

Does Java provide a way to intelligently "aggregate" transactions? If I have multiple, heterogeneous data repositories I want to keep synchronized (ie Postgres for data, Neo4j for a graph, and Lucene for an index) is there a paradigm for only allowing N concrete transactions to either succeed or fail, but make sure that they do so consistently (via this "aggregate" transaction)? For example - the Postgres update commits but the Neo4j update fails: the Postgres update gets rolled back, the Lucene update isn't even attempted, and an exception is thrown.

4

1 回答 1

0

Spring Transaction API 框架允许像这样聚合事务。但是,它对部分提交没有帮助,因为它特定于您使用的数据源。因此,必须在您的代码中处理部分事务已提交而部分未提交的情况。

于 2013-09-10T03:26:41.630 回答