1
0
mirror of https://github.com/fzaninotto/Faker.git synced 2025-03-20 23:39:51 +01:00

disable instance pool to same memory on big inserts via Propel ORM

This commit is contained in:
Francois Zaninotto 2011-10-24 13:02:23 +02:00
parent 900e81aed6
commit 2729d3a0a1

View File

@ -51,6 +51,8 @@ class Populator
if (null === $con) {
$con = $this->getConnection();
}
$isInstancePoolingEnabled = \Propel::isInstancePoolingEnabled();
\Propel::disableInstancePooling();
$insertedEntities = array();
$con->beginTransaction();
foreach ($this->quantities as $class => $number) {
@ -59,6 +61,9 @@ class Populator
}
}
$con->commit();
if ($isInstancePoolingEnabled) {
\Propel::enableInstancePooling();
}
return $insertedEntities;
}