Fork me on GitHub
#datomic
<
2015-12-05
>
genRaiy15:12:05

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

genRaiy16:12:24

i found a more interesting example on the day of datomic

paxan21:12:18

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]])

paxan21:12:59

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