Skip to content

Commit

Permalink
Fix DDC-1787.
Browse files Browse the repository at this point in the history
Credit goes to Jack van Galen for fixing this issue.
Fix for JoinedSubclassPersister, multiple inserts with versioning throws
an optimistic locking exception.
  • Loading branch information
aaronmu committed Dec 14, 2013
1 parent 600af3e commit 3cc6307
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/Doctrine/ORM/Persisters/JoinedSubclassPersister.php
Expand Up @@ -181,6 +181,10 @@ public function executeInserts()
$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) {
Expand Down Expand Up @@ -212,10 +216,6 @@ public function executeInserts()
$stmt->closeCursor();
}

if ($this->class->isVersioned) {
$this->assignDefaultVersionValue($entity, $id);
}

$this->queuedInserts = array();

return $postInsertIds;
Expand Down

0 comments on commit 3cc6307

Please sign in to comment.