1
0
mirror of synced 2025-01-19 06:51:40 +03:00

#1169 DDC-3343 - eagerly evicting cache if a persister passes a delete operation down to the DB

This commit is contained in:
Marco Pivetta 2015-01-27 09:04:00 +01:00
parent c4019d96b9
commit a9671fdc2e

View File

@ -78,9 +78,13 @@ class NonStrictReadWriteCachedEntityPersister extends AbstractEntityPersister
*/ */
public function delete($entity) public function delete($entity)
{ {
$this->persister->delete($entity); $key = new EntityCacheKey($this->class->rootEntityName, $this->uow->getEntityIdentifier($entity));
$this->queuedCache['delete'][] = new EntityCacheKey($this->class->rootEntityName, $this->uow->getEntityIdentifier($entity)); if ($this->persister->delete($entity)) {
$this->region->evict($key);
}
$this->queuedCache['delete'][] = $key;
} }
/** /**