Martin Adámek
Martin Adámek
Well, using `Promise.all` on single EM instance is never good idea if you ask me. You are working with a single context in parallel, this will introduce race conditions.
I will need to review this first, maybe its something stupid we can fix. I believe the read operations should be rather fine with `Promise.all` but that does not mean...
I am not following, what issues? `em.populate` ignores already loaded relations. This would be problem only with partial loading - you can't really lazy load 1:1 owner if you did...
Then are you really sure there is a value in the database? :] But it should be `null` in that case I guess, not `undefined`. `undefine` sounds more like an...
Can you update the repro so it creates some inital data too? And maybe run things multiple times to catch the error?
I could imagine a race condition where the entity gets added to identity map before it is hydrated - but we need that, not much we can do here. And...
Tried to reproduce based on the code in OP. Ran the final part 10000 times in a row, havent seen that error single time 🤷 Not much I can do...
Let me try with postgres, but I dont think this is about pooling, it needs to be a race in hydrating the entity which happens at ORM level. edit: same...
> Cannot read properties of undefined (reading 'getItems')
This is the place where we conditionally add incomplete entities to the identity map so we can resolve cycles, that would be my first suspect. https://github.com/mikro-orm/mikro-orm/blob/master/packages/core/src/entity/EntityFactory.ts#L209-L212