Skip to content

Commit

Permalink
disable instance pool to same memory on big inserts via Propel ORM
Browse files Browse the repository at this point in the history
  • Loading branch information
fzaninotto committed Oct 24, 2011
1 parent 900e81a commit 2729d3a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Faker/ORM/Propel/Populator.php
Expand Up @@ -51,6 +51,8 @@ public function execute($con = null)
if (null === $con) {
$con = $this->getConnection();
}
$isInstancePoolingEnabled = \Propel::isInstancePoolingEnabled();
\Propel::disableInstancePooling();
$insertedEntities = array();
$con->beginTransaction();
foreach ($this->quantities as $class => $number) {
Expand All @@ -59,6 +61,9 @@ public function execute($con = null)
}
}
$con->commit();
if ($isInstancePoolingEnabled) {
\Propel::enableInstancePooling();
}

return $insertedEntities;
}
Expand Down

0 comments on commit 2729d3a

Please sign in to comment.