Fork me on GitHub

can anyone point me at any transaction functions that use require or are more than one line examples? Struggling with google for this 😕


i found a more interesting example on the day of datomic


Is it considered an anti-pattern if a database transaction function can only produce consistent results if it runs in a transaction all by itself? E.g. running :do/thing twice in one transaction on parameters that aren't independent like so: (d/transact conn [[:do/thing x y z] [:do/thing x y p q]]) would, due to the implementation details, yield bad results. So instead we have to run that as two separate transactions:

(d/transact conn [[:do/thing x y z]])
(d/transact conn [[:do/thing x y p q]])


I've just realized that it's not an anti-pattern, all thanks to writing this question down.