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:
parent
600af3e617
commit
3cc630798b
@ -181,6 +181,10 @@ class JoinedSubclassPersister extends AbstractEntityInheritancePersister
|
|||||||
$id = $this->em->getUnitOfWork()->getEntityIdentifier($entity);
|
$id = $this->em->getUnitOfWork()->getEntityIdentifier($entity);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($this->class->isVersioned) {
|
||||||
|
$this->assignDefaultVersionValue($entity, $id);
|
||||||
|
}
|
||||||
|
|
||||||
// Execute inserts on subtables.
|
// Execute inserts on subtables.
|
||||||
// The order doesn't matter because all child tables link to the root table via FK.
|
// The order doesn't matter because all child tables link to the root table via FK.
|
||||||
foreach ($subTableStmts as $tableName => $stmt) {
|
foreach ($subTableStmts as $tableName => $stmt) {
|
||||||
@ -212,10 +216,6 @@ class JoinedSubclassPersister extends AbstractEntityInheritancePersister
|
|||||||
$stmt->closeCursor();
|
$stmt->closeCursor();
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($this->class->isVersioned) {
|
|
||||||
$this->assignDefaultVersionValue($entity, $id);
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->queuedInserts = array();
|
$this->queuedInserts = array();
|
||||||
|
|
||||||
return $postInsertIds;
|
return $postInsertIds;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user