Reputation: 102
I'm playing around with clojure/datomic and I setup a really simple website using datomic on-prem about two weeks ago.
When I wanted to check how much data I had been colecting I started a repl and made a connection to datomic. The result showed something like this:
#object[datomic.peer.Connection 0xfbe8fd3
"{:unsent-updates-queue 0, :pending-txes 0,
:next-t 12021, :basis-t 12020, :index-rev 0,
:db-id \"my-website-b2e771e0-c8bb-4397-a6c0-0981516c0a0d\"}"]
And there was no data other than the tests I made.
Then I checked some of the logs I had and the transactions look like this:
post insertion resp #object[datomic.promise$settable_future$reify__7373 0x56e2a1c5 {:status :ready,
:val {:db-before datomic.db.Db@5ddcffae,
:db-after datomic.db.Db@63d04810,
:tx-data #object[java.util.Arrays$ArrayList 0x3be44815 [datomic.db.Datum@fbfd09b6]],
:tempids {-9223301668109598143 17592186045431}}}]
post insertion resp #object[datomic.promise$settable_future$reify__7373 0x70fe2f2c {:status :ready,
:val {:db-before datomic.db.Db@63d04810,
:db-after datomic.db.Db@72e1eed2,
:tx-data #object[java.util.Arrays$ArrayList 0x58541f8 [datomic.db.Datum@7502796a]],
:tempids {-9223301668109598142 17592186045432}}}]
So I did some research and now I know that I must dereference when I make the transaction to the db. But I would like to know if there's a way to get the data from all those promises that weren't dereferenced or if they are gone.
Thanks.
Upvotes: 1
Views: 123
Reputation: 54603
When you send off a transaction, whether or not it succeeds is not related to whether or not you dereference it in the client code. If the transaction fails, you might not notice that if you don't deref it, since your code will just send it off and not care too much about how it all went.
But, if you did send off a bunch of transactions that the transactor for some reason wasn't able to apply, and you didn't log them anyhwhere, they're gone forever. I don't believe the transactor keeps a log of failed transactions.
Upvotes: 1