Sequencing Datomic transactions without intermediate effects

OP's question:
How can changes to be made to a Datomic database be grouped in a way that they either all succeed or they all fail? Think of transactions in SQL, via BEGIN and COMMIT/ROLLBACK. —
Datomic is designed to let you do functional programming, which means you shouldn't need to worry about sequencing side effects like this. (If you did, Datomic would be broken.)
Here is one way to do it. Business logic is pure functions like this:
A naive way to compose the biz functions without introducing side effects (intermediate d/transact!)
Implementing comp