DDC-2267: EntityManager throws an exception when trying to flush($entity) on a deleted entity #2846

Closed
opened 2026-01-22 14:05:38 +01:00 by admin · 3 comments
Owner

Originally created by @doctrinebot on GitHub (Jan 31, 2013).

Originally assigned to: @beberlei on GitHub.

Jira issue originally created by user gena01:

$entity = $em->find("Bug", 1);
$em->remove($entity);
$em->flush($entity);

Throws an exception. Works fine with $em->flush() (No $entity provided).

Would be nice to just flush the deleted entity separate from other entities. This technically works for other operations except remove(). The exception claims that the entity is not mapped. It technically can't be mapped since it's set to be deleted.

Originally created by @doctrinebot on GitHub (Jan 31, 2013). Originally assigned to: @beberlei on GitHub. Jira issue originally created by user gena01: $entity = $em->find("Bug", 1); $em->remove($entity); $em->flush($entity); Throws an exception. Works fine with $em->flush() (No $entity provided). Would be nice to just flush the deleted entity separate from other entities. This technically works for other operations except remove(). The exception claims that the entity is not mapped. It technically can't be mapped since it's set to be deleted.
admin added the Bug label 2026-01-22 14:05:38 +01:00
admin closed this issue 2026-01-22 14:05:39 +01:00
Author
Owner

@doctrinebot commented on GitHub (Jan 31, 2013):

@doctrinebot commented on GitHub (Jan 31, 2013): - is duplicated by [DDC-2309: Invalid behaviour to flush only one entity](http://www.doctrine-project.org/jira/browse/DDC-2309)
Author
Owner

@doctrinebot commented on GitHub (May 4, 2013):

Comment created by @beberlei:

Fixed in 2.3 branch, for 2.3.4

@doctrinebot commented on GitHub (May 4, 2013): Comment created by @beberlei: Fixed in 2.3 branch, for 2.3.4
Author
Owner

@doctrinebot commented on GitHub (May 4, 2013):

Issue was closed with resolution "Fixed"

@doctrinebot commented on GitHub (May 4, 2013): Issue was closed with resolution "Fixed"
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#2846