mirror of
https://github.com/google/nomulus
synced 2026-01-06 13:36:48 +00:00
The old semantics for TransactionalFlow meant "anything that needs to mutate the database", but then FlowRunner was not creating transactions for non-transactional flows even though nearly every flow needs a transaction (as nearly every flow needs to hit the database for some purpose). So now TransactionalFlow simply means "any flow that needs the database", and MutatingFlow means "a flow that mutates the database". In the future we will have FlowRunner use a read-only transaction for TransactionalFlow and then a normal writes-allowed transaction for MutatingFlow. That is a TODO. This also fixes up some transact() calls inside caches to be reTransact(), as we rightly can't move the transaction outside them as from some callsites we legitimately do not know whether a transaction will be needed at all (depending on whether said data is already in memory). And it removes the replicaTm() calls which weren't actually doing anything as they were always nested inside of normal tm()s, thus causing confusion.