Skip to content
This repository has been archived by the owner on Jan 9, 2025. It is now read-only.

Storer to mimic XA transactions #537

Answered by hg-ms
guykatz asked this question in Q&A
Discussion options

You must be logged in to vote

Hi,
From our docu regarding transaction:

MicroStream does not provide explicit transactions, every call to a store method is automatically a transaction.
A store operation is an atomic all or nothing operation
If the store call is successful all data is written to the storage. Otherwise, no data is persisted. Partially persisted data will be reverted.

To mimic a XA transaction you can use an explicit Storer.
Storer storer = storageManager.createStorer()
That way you have two phases:

  1. Data Collection
    After creating a new storer it has no data to store. To “collect” that data use the store() and storeAll() methods of the storer. You can do more than one ’store()’.
    If you decide to abort…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by guykatz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants