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:
parent
900e81aed6
commit
2729d3a0a1
@ -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;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user