Search code examples
xodus

Can Xodus Entity Stores share a transaction?


I can see it is possible to use a single Environment transaction to work on multiple stores. (I'm also assuming writes are possible too).

The high level api of Entity Stores is very convenient for me, but I could not find a way of sharing Entity Store transactions. Looking at the code, I can see entity stores are actually creating Environment transactions but since these are individual transactions I cannot perform operations across multiple stores and commit/abort a single transaction.

Am I missing something or should I say goodbye to Entity Store apis and fall back to Store API?


Solution

  • I was the one who initially asked that question to which you are referencing.

    In Xodus there are three different ways to use it: - Environments; - Entity Stores; - VFS.

    I'm using Environments API and all Transactions are created for whole Environment. And as I understood correctly you are using Entity Stores API, so you are able to use only StroreTransaction which is started only for a particular Store and to manipulate its Entities.

    So, if you require to share one transaction against multiple stores then you require to switch to Environment API.

    • Taras