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/1751
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)
https://forum.datomic.com/t/new-client-release-for-pro-0-9-66-and-cloud-0-8-105/1752
Exactly Francis, that is what I do and with exactly the same arguments.
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