-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Lost Update when using Deferred Explicit change tracking, Remove followed by Persist. #8231
Milestone
Comments
skurfuerst
added a commit
to neos/neos-development-collection
that referenced
this issue
Aug 7, 2020
Fixes Behat testcases; not sure whether it happens in production; as the workaround is to call PersistenceManager->persistAll() twice... The corresponding Doctrine bug is at doctrine/orm#8231
skurfuerst
added a commit
to neos/neos-development-collection
that referenced
this issue
Aug 7, 2020
Fixes Behat testcases; not sure whether it happens in production; as the workaround is to call PersistenceManager->persistAll() twice... The corresponding Doctrine bug is at doctrine/orm#8231
neos-bot
pushed a commit
to neos/content-repository
that referenced
this issue
Aug 10, 2020
Fixes Behat testcases; not sure whether it happens in production; as the workaround is to call PersistenceManager->persistAll() twice... The corresponding Doctrine bug is at doctrine/orm#8231
@skurfuerst Valid report, please make it a pull request against the 2.7 branch. |
neos-bot
pushed a commit
to neos/content-repository
that referenced
this issue
Oct 30, 2020
Fixes Behat testcases; not sure whether it happens in production; as the workaround is to call PersistenceManager->persistAll() twice... The corresponding Doctrine bug is at doctrine/orm#8231
neos-bot
pushed a commit
to neos/content-repository
that referenced
this issue
Dec 4, 2020
Fixes Behat testcases; not sure whether it happens in production; as the workaround is to call PersistenceManager->persistAll() twice... The corresponding Doctrine bug is at doctrine/orm#8231
beberlei
added a commit
to beberlei/doctrine2
that referenced
this issue
Dec 13, 2020
When an entity with change tracking policy "deferred explicit" gets removed, then persisted again, it is not schedulded for a dirty check synchronization. This is not the case for entities that are persisted and are already in the managed state.
beberlei
added a commit
to beberlei/doctrine2
that referenced
this issue
Dec 13, 2020
When an entity with change tracking policy "deferred explicit" gets removed, then persisted again, it is not schedulded for a dirty check synchronization. This is not the case for entities that are persisted and are already in the managed state.
beberlei
added a commit
that referenced
this issue
Dec 14, 2020
When an entity with change tracking policy "deferred explicit" gets removed, then persisted again, it is not schedulded for a dirty check synchronization. This is not the case for entities that are persisted and are already in the managed state.
markusguenther
pushed a commit
to markusguenther/neos-development-collection
that referenced
this issue
Mar 25, 2021
Fixes Behat testcases; not sure whether it happens in production; as the workaround is to call PersistenceManager->persistAll() twice... The corresponding Doctrine bug is at doctrine/orm#8231
neos-bot
pushed a commit
to neos/content-repository
that referenced
this issue
Oct 7, 2022
Fixes Behat testcases; not sure whether it happens in production; as the workaround is to call PersistenceManager->persistAll() twice... The corresponding Doctrine bug is at doctrine/orm#8231
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
... That's hard to describe, I'll try nevertheless :-)
Background
$entity
.How to reproduce
$entityManager->remove($entity);
$entity->setFoo('bar');
$entityManager->persist($entity);
$entityManager->flush();
Root Cause Analysis:
$entityManager->remove($entity);
UnitOfWork::doRemove()
, where the entity is marked withUnitOfWork::STATE_REMOVED
.$entity->setFoo('bar');
$entityManager->persist($entity);
UnitOfWork::doPersist()
.UnitOfWork::STATE_MANAGED
again (it was marked as removed beforehand).UnitOfWork::scheduleForDirtyCheck()
, which it would call if the entity was alreadyin
STATE_MANAGED
. We rely on thisscheduleForDirtyCheck
to be called, because we use DEFERRED_EXPLICIT as change tracking policy.$entityManager->flush();
Suggested fix:
in
UnitOfWork::doPersist
Note: this issue appeared as part of neos/neos-development-collection#3015
Thanks for your great work :)
Sebastian
The text was updated successfully, but these errors were encountered: