How nubank operates without traditional transaction features like commit/rollback?

Actually I came up to the same case described here .

My current solution is the same, transact statements using with each time accumulating statements, each next call is done to the db returned from with. In the case of success all collected changes are pushed to real database in the single call, but some questions arise:

  1. What if some statements(previously executed step by step on memory db returned from with) call transaction functions which might depend on result from the previously transacted statements. In such case collected statements can’t be called at once on real database
  2. If some statement creates entity and the next one uses id of that entity then such statements can’t be executed at once.
  3. If first statement creates a entity and the next one retracts the entity

P.S. Maybe the most right solution in this case is to develop in a way which do not need rollback but maximally use features which are provided by datomic to keep data constraints

P.P.S Why I asked about nubank because usually logic of bank operations is not so simple and can be described as:

try {
0. Open transaction
1. do this
2. put some data here
3. change data there
4. Commit
catch (Exception e) {
  rollback transaction
}