Fork me on GitHub
#datomic
<
2019-08-02
>
matthavener14:08:36

Is the “single parent” policy implied by isComponent true attributes enforced by datomic? It seems like I can add another parent to a child, and then the backref behavior is really strange

matthavener14:08:36

here’s what i’m seeing (both asserts pass)

souenzzo14:08:47

Yes, you can If :foo/bar isComponent and you insert [2 :foo/bar 1] and [3 :foo/bar 1] - if you retractEntity 3, 1 will be retracted - if you retractEntity 2, 1 will be retracted - in pull/entity API if you ask for for :foo/_bar from 1, it will return just 2 or just 3 "randomly" - in query, it should not effect

matthavener14:08:29

thanks @souenzzo 🙂, that’s exactly what I’m seeing but the semantics were just confusing at first

souenzzo14:08:10

I think that it is discouraged, but this behavior will not change AFIK

matthavener14:08:36

yeah, having a “consistent view” of the db and a backref that is “random” doesn’t exactly jive

matthavener14:08:51

just have to add more validation to my txns to ensure ever child only has one parent

souenzzo14:08:19

new ensure / spec features should help important to say that it's a stable "random"

matthavener14:08:22

stable for a given value of db?

matthavener14:08:28

until a reindex or something?

souenzzo15:08:00

I'd rather leave it to someone on the datomic team to answer that.

nilpunning16:08:59

Does anyone know if datomi.api/gc-storage collects just on the database specified in the connection or across all databases in the Datomic deployment? https://docs.datomic.com/on-prem/clojure/index.html#datomic.api/gc-storage

rgorrepati22:08:39

Can someone tell me why the above wouldn’t work?