You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am getting an odd bug when I am removing an entity using the entity manager. An exception is being thrown saying "A new entity was found through a relationship that was not configured to cascade persist operations" but there are no new entities explicitly created.
This is the relevant piece of code and I have attached a full reduced test case.
Fatal error: Uncaught exception 'InvalidArgumentException' with message 'A new entity was found through a relationship
that was not configured to cascade persist operations: Bar@0000000049dcca970000000025d8d6f9. Explicitly persist
the new entity or configure cascading persist operations on the relationship.' in doctrine2-orm/lib/Doctrine/ORM/UnitOfWork.php:576
Stack trace:
#0 doctrine2-orm/lib/Doctrine/ORM/UnitOfWork.php(495): Doctrine\ORM\UnitOfWork >computeAssociationChanges(Array, Object(Doctrine\ORM\PersistentCollection))
#1 doctrine2-orm/lib/Doctrine/ORM/UnitOfWork.php(537): Doctrine\ORM\UnitOfWork->computeChangeSet(Object(Doctrine\ORM\Mapping\ClassMetadata), Object(Foo))
#2 doctrine2-orm/lib/Doctrine/ORM/UnitOfWork.php(256): Doctrine\ORM\UnitOfWork->computeChangeSets()
#3 doctrine2-orm/lib/Doctrine/ORM/EntityManager.php(334): Doctrine\ORM\UnitO in doctrine2-orm/lib/Doctrine/ORM/UnitOfWork.php on line 576
A few other things I have noticed:
Removing the transactional wrapper and using the DBAL connection transaction fixes the problem
Removing the query before the update fixes the problem.
The remove works without using an explicit transaction
The text was updated successfully, but these errors were encountered:
Jira issue originally created by user mitmaro:
I am getting an odd bug when I am removing an entity using the entity manager. An exception is being thrown saying "A new entity was found through a relationship that was not configured to cascade persist operations" but there are no new entities explicitly created.
This is the relevant piece of code and I have attached a full reduced test case.
Exception:
A few other things I have noticed:
The text was updated successfully, but these errors were encountered: