Fork me on GitHub
#datomic
<
2015-11-23
>
pesterhazy15:11:42

I transact a single, large transaction (10,000s of txs), but datomic reports :db.error/tempid-not-an-entity tempid used only as value in transaction. Is there a way to see which tempid is failing the transaction?

pesterhazy15:11:20

I looked at transactor logs (with log level :debug), but it doesn't print the culprit

robert-stuttaford15:11:54

you have a tempid with no attr/values assigned

robert-stuttaford15:11:06

something like {:db/id (d/tempid :db.part/user)}

robert-stuttaford15:11:06

(shooting from the hip here, i admit simple_smile )

pesterhazy15:11:36

I'm using only the [:db/add e a v] form

pesterhazy16:11:25

My assumption is that this error means that I'm using a tempid as a value but not (in the same tx-data) also as an entity

pesterhazy16:11:13

still working on the EDN exporter btw simple_smile

pesterhazy16:11:25

almost there.. except for this pesky bug

robert-stuttaford16:11:26

a tempid needs to appear at least once in E position

robert-stuttaford16:11:44

you likely have a ref to a tempid without actually giving that tempid some data

pesterhazy16:11:09

that's the thing -- if I read my tx-data correctly, I've removed all those instance

robert-stuttaford16:11:50

you should be able to write some scratch code to find all tempids in V position and validate that they all appear in E position at least once

robert-stuttaford16:11:09

also - are all your enums included in your dataset?

robert-stuttaford16:11:31

[:db/add (tempid) :db/ident :status/awesome] these guys

robert-stuttaford16:11:39

gotta run. good luck!

pesterhazy16:11:57

thanks, very helpful

domkm22:11:54

Questions for Cognitects: I'm building a type system on top of Datomic and have encountered a few anomalies. Why aren't functions installed with db.install/function (`:db.fn/cas` and :db.fn/retractEntity are values of :db.install/function)? What is :db.bootstrap/part? It's not referenced by any other entities. It looks like an artifact of DB bootstrap process that should maybe be retracted. CC @bkamphaus

domkm22:11:28

Meta question: Is building a type system for entities a bad idea? 😉

taylor.sando22:11:23

Spec-tacular something with types.