0

executeInTransaction calls flush, not commit. I did some testing and flush does persist changes to the database across program runs, which to me is the definition of commit. So what is the difference between these two operations?

Put another way, what would motivate the decision to use flush over commit, or vice versa?

1 Answers1

3

flush does not finish the transaction, while commit does.

Maxim Mazin
  • 3,816
  • 1
  • 21
  • 15
  • I do understand that from reading the code, but what I don't understand is why as a user of xodus I care if it is finished? – Danny MacMillan Jan 02 '19 at 15:01
  • You don't. Commit is a kind of internal operation. All transactions are committed at the end of the block unless there was an exception. You may want to make an intermediate transaction flush without closing the transaction, e.g., you save a huge amount of data in packs, and you flush the data after each pack. – Maxim Mazin Jan 03 '19 at 17:45