From 2729d3a0a13d3048f90a88407861a38f5deaf703 Mon Sep 17 00:00:00 2001 From: Francois Zaninotto Date: Mon, 24 Oct 2011 13:02:23 +0200 Subject: [PATCH] disable instance pool to same memory on big inserts via Propel ORM --- src/Faker/ORM/Propel/Populator.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Faker/ORM/Propel/Populator.php b/src/Faker/ORM/Propel/Populator.php index c62d19fa..cf50cc15 100644 --- a/src/Faker/ORM/Propel/Populator.php +++ b/src/Faker/ORM/Propel/Populator.php @@ -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; }