since 2 weeks, we are having this problem while trying to flush new elements:
CRITICAL: DoctrineORMORMInvalidArgumentException:
A new entity was found through the relationship 'Comment#capture' that was not configured to cascade persist operations for entity
But the capture
is already in the database, and we are getting it by a findOneBy
, so if we cascade persist it, or persist it, we get a
Table constraint violation: duplicate entry.
The comments are created in a loop with differents captures, with a new, and all required field are set.
With all of the entities persisted and / or got by a findOne
(and all valid), the flush still fails.
I'm on this issue since a while, so please help me
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…