UnitOfWork::commit with specific entity erases scheduledForSynchronization for all other entities #5310

Open
opened 2026-01-22 15:04:06 +01:00 by admin · 2 comments
Owner

Originally created by @n3b on GitHub (Nov 3, 2016).

$entityA->setProperty('value');
$entityB->setProperty('value');

$em->flush($entityA); // entityA updated
$em->flush(); // does nothing
Originally created by @n3b on GitHub (Nov 3, 2016). ```php $entityA->setProperty('value'); $entityB->setProperty('value'); $em->flush($entityA); // entityA updated $em->flush(); // does nothing ```
Author
Owner

@Ocramius commented on GitHub (Nov 3, 2016):

Do you have a failing test case for this scenario? Can't reproduce this one
locally.

On 3 Nov 2016 03:24, "Maxim Vorobey" notifications@github.com wrote:

$entityA->setProperty('value');$entityB->setProperty('value');$em->flush($entityA); // entityA updated$em->flush(); // does nothing


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/doctrine/doctrine2/issues/6112, or mute the thread
https://github.com/notifications/unsubscribe-auth/AAJakLVSs2MCoK2tVaGKU7NDaptTkT65ks5q6UXWgaJpZM4Kn8y_
.

@Ocramius commented on GitHub (Nov 3, 2016): Do you have a failing test case for this scenario? Can't reproduce this one locally. On 3 Nov 2016 03:24, "Maxim Vorobey" notifications@github.com wrote: > $entityA->setProperty('value');$entityB->setProperty('value');$em->flush($entityA); // entityA updated$em->flush(); // does nothing > > — > You are receiving this because you are subscribed to this thread. > Reply to this email directly, view it on GitHub > https://github.com/doctrine/doctrine2/issues/6112, or mute the thread > https://github.com/notifications/unsubscribe-auth/AAJakLVSs2MCoK2tVaGKU7NDaptTkT65ks5q6UXWgaJpZM4Kn8y_ > .
Author
Owner

@n3b commented on GitHub (Nov 3, 2016):

@Ocramius Sorry, I forgot to mention that we are using the Notify change tracking policy. Thus, the UnitOfWork::scheduledForSynchronization contains both entities before the first flush and is empty before the second one.

@n3b commented on GitHub (Nov 3, 2016): @Ocramius Sorry, I forgot to mention that we are using the Notify change tracking policy. Thus, the `UnitOfWork::scheduledForSynchronization` contains both entities before the first flush and is empty before the second one.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#5310