1
0
mirror of synced 2025-01-18 06:21:40 +03:00

Fix DDC-1787.

Credit goes to Jack van Galen for fixing this issue.
Fix for JoinedSubclassPersister, multiple inserts with versioning throws
an optimistic locking exception.
This commit is contained in:
Aaron Muylaert 2013-12-14 13:50:46 +01:00
parent 600af3e617
commit 3cc630798b

View File

@ -181,6 +181,10 @@ class JoinedSubclassPersister extends AbstractEntityInheritancePersister
$id = $this->em->getUnitOfWork()->getEntityIdentifier($entity);
}
if ($this->class->isVersioned) {
$this->assignDefaultVersionValue($entity, $id);
}
// Execute inserts on subtables.
// The order doesn't matter because all child tables link to the root table via FK.
foreach ($subTableStmts as $tableName => $stmt) {
@ -212,10 +216,6 @@ class JoinedSubclassPersister extends AbstractEntityInheritancePersister
$stmt->closeCursor();
}
if ($this->class->isVersioned) {
$this->assignDefaultVersionValue($entity, $id);
}
$this->queuedInserts = array();
return $postInsertIds;