Fork me on GitHub
#datomic
<
2015-12-07
>
tcrayford12:12:08

@magnars: were you using just any old negative number, or were you specifically calling d/tempid?

tcrayford12:12:38

ohh, that has to do with transaction functions…

magnars12:12:28

yes, calling d/tempid from transaction functions is perilous, since you might get the same tempid from your own process, resulting in non-deterministic bad data.

tcrayford12:12:15

@magnars: yeah, eww 😞

tcrayford13:12:17

@magnars it seems like the datomic team could maybe "fix" this by reserving a portion of the tempid space to be transactor generated only. It probably doesn't need to be too large.

magnars13:12:11

@tcrayford: They have known about the issue for a few years. I'm not sure why it isn't a priority. Seems like a pretty bad result. Maybe people aren't using transaction functions.

robert-stuttaford13:12:31

@magnars i think i saw someone saying that by convention they explicitly set tempids in tx functions, starting at a number far away from where in-proc tempids would be

robert-stuttaford13:12:13

we’ve got like two tx functions and we haven’t had this issue with either of them

magnars13:12:43

@robert-stuttaford: that sounds good. Maybe it was fixed and I haven't spotted it in the change log.

magnars13:12:25

Can't see it in the changelog, but I'll upgrade regardless.

robert-stuttaford13:12:11

@magnars: sorry, i meant to say that i saw someone who merely uses Datomic say that this is how they dealt with this issue

robert-stuttaford13:12:27

they explicitly make temp-ids starting at a number that’s far away from where Datomic starts by default

robert-stuttaford13:12:41

been trying to find the source but i can’t

magnars13:12:29

aha, yes. That would be another way of fixing it. I think I like my even/odd approach better tho, since there's no risk of collision.

robert-stuttaford13:12:50

you’re never going see em, so whatever’s sensible

magnars13:12:55

might be a purely theoretical advantage tho simple_smile

pesterhazy17:12:09

@robert-stuttaford: I managed to finish my datomic exporter, based on your work

pesterhazy17:12:38

it should work for pretty large dbs

robert-stuttaford17:12:14

@pesterhazy: hey, cool! any feedback for me? any bits in particular that made the cut?

robert-stuttaford17:12:19

regardless of how much of it you ended up using, i will shamelessly admit that i thoroughly enjoyed writing it. transducers ftw

raymcdermott20:12:00

guys… I have made my first tx function to handle component updates a little more completely than comes out of the box

raymcdermott20:12:22

I would appreciate some comments on whether the code follows the intentions of such functions

raymcdermott20:12:35

I have also create a gist if it’s too hard to read here https://gist.github.com/raymcdermott/57ade5ae671f83d2444e

raymcdermott20:12:48

the idea is to support cases where the component entities are not just the ones created with the entity … it should be possible to add new entries, delete entries and update existing entries by passing in the component entity map

raymcdermott20:12:15

I am using it for a shopping cart use case where items are often subject to these operations

raymcdermott20:12:27

any hints or tips would be appreciated

raymcdermott21:12:29

🕸 is it just me or it getting dusty in here