Is there a database lock mechanism?
Does not sound like a multi-threading issue to me?
If you have two childs having the the same new parent in the entity reference field (BTW, what approach do use for creation, this is rather tricky ..), it will be probably created &quot;twice&quot;, but with different ids - no?
Why don't you create the parent entity first and assign it afterwards to the entity-reference field target_id or entity property (if you are controlling it yourself)?