title: Doctrine multiple flush commit once
body: <p>I do a lot of search without success.
  I would like to understand the flush() process in this situation.</p>
  
  <pre><code>//Edit updateOptions
  public function updateOptions($values){
      setOption('country',$values['country']);
      setOption('city',$values['city']);
      setOption('adress',$values['adress']);
      setOption('CP',$values['CP']);
      setOption('country_code',$values['country_code']);
  }
  
  
  function setOption($name, $value){
  
       $em = $this-&gt;getEntityManager('option.manager');
  
       $option = $this-&gt;getOption($name); //Entity Options
       $option-&gt;setValue($value);
  
       $em-&gt;persist($option);
       $em-&gt;flush();
  }
  </code></pre>
  
  <p>When I look the mysql.log or the profiler, i found this:</p>
  
  <pre><code>START TRANSACTION
  UPDATE options SET value = 'France' WHERE name = 'country';
  COMMIT
  START TRANSACTION
  SAVEPOINT DOCTRINE2_SAVEPOINT_2
  UPDATE options SET value = 'Paris' WHERE name = 'city';
  RELEASE SAVEPOINT DOCTRINE2_SAVEPOINT_2
  SAVEPOINT DOCTRINE2_SAVEPOINT_2
  UPDATE options SET value = 'Rue de Rivoli' WHERE name = 'adress';
  RELEASE SAVEPOINT DOCTRINE2_SAVEPOINT_2
  SAVEPOINT DOCTRINE2_SAVEPOINT_2
  UPDATE options SET value = '75001' WHERE name = 'CP';
  RELEASE SAVEPOINT DOCTRINE2_SAVEPOINT_2
  SAVEPOINT DOCTRINE2_SAVEPOINT_2
  UPDATE options SET value = '33' WHERE name = 'country_code';
  RELEASE SAVEPOINT DOCTRINE2_SAVEPOINT_2
  ROLLBACK
  </code></pre>
  
  <p>Only the first one is updated/committed, I get it, but i don't see why the next are rolled back?</p>
  
  <p>This situation also occur if I use setOption() inside a loop for example.</p>
  
  <p>A help would be great.
  Thanks in advance.</p>