diff --git a/lib/Doctrine/Connection/UnitOfWork.php b/lib/Doctrine/Connection/UnitOfWork.php index 109c0219c..db20cf27f 100644 --- a/lib/Doctrine/Connection/UnitOfWork.php +++ b/lib/Doctrine/Connection/UnitOfWork.php @@ -290,6 +290,8 @@ class Doctrine_Connection_UnitOfWork extends Doctrine_Connection_Module $record->getTable()->getRecordListener()->postDelete($event); $record->postDelete($event); + + $record->getTable()->removeRecord($record); $this->conn->commit(); diff --git a/lib/Doctrine/Table.php b/lib/Doctrine/Table.php index f507df71f..b78476510 100644 --- a/lib/Doctrine/Table.php +++ b/lib/Doctrine/Table.php @@ -1049,6 +1049,26 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable return true; } + /** + * removeRecord + * removes a record from the identity map, returning true if the record + * was found and removed and false if the record wasn't found. + * + * @param Doctrine_Record $record record to be removed + * @return boolean + */ + public function removeRecord(Doctrine_Record $record) + { + $id = implode(' ', $record->identifier()); + + if (isset($this->_identityMap[$id])) { + unset($this->_identityMap[$id]); + return true; + } + + return false; + } + /** * getRecord * first checks if record exists in identityMap, if not