Hello, I have created a function which makes a query to datomic dev-local. When I call it as a normal function the query returns data. When I call it as a transaction function on the same db the query returns nothing. Any ideas?! Many thanks
Cognitect dev-tools version 0.9.58 now available. https://forum.datomic.com/t/cognitect-dev-tools-version-0-9-58-now-available/17513👍
Confirm, your fn signature looks like
(defn fn-name [db arg1 arg2 ,,,]) , you call it “normally” like
(fn-name db arg1 arg2 ,,,) and you “call” it in a tx like
[,,, ['namespace/fn-name arg1 arg2] ,,,] (note fully qualified, implicit db arg omitted)
Exactly Francis, that is what I do and with exactly the same arguments.
I haven't personally done so, but I'm pretty sure you can https://forum.datomic.com/t/kafka-consumer-as-an-ion/823
How do you know the results are different?
I throw an exception in the transaction and I include in the message the result of the query. In the case of the transaction it is an empty vector.
It does not find what the non-transaction related function call finds.
And you are sure they are the same db?
In the non-trans version I use (d/db conn) using the same conn as the one in the trans version. So I guess they are the same.
And I dont change anything in between
Excellent! Many thanks