code: public function updateReferenceTable(GenderNameModel $model)
      {
          $this->emptyReferenceTable();
          $em = $this->getEntityManager();
  
          $preppedData = $model->prepareGenderNameData();
          $batchSize   = 200;
          $count       = 0;
  
          echo 'Inserting data'.PHP_EOL;
          foreach ($preppedData as $datum) {
              $record = new PluginEnhancerGenderName();
              $record
                  ->setName($datum['name'])
                  ->setGender($datum['gender'])
                  ->setProbability($datum['probability'])
                  ->setCount($datum['count']);
              $em->persist($record);
              ++$count;
              if (0 === ($count % $batchSize)) {
                  $em->flush();
                  $em->clear();
              }
          }
          $em->flush();
          $em->clear();
      }
docs: @param GenderNameModel $model
  
  @throws \Doctrine\ORM\OptimisticLockException