title: Doctrine2 ORM - persist operations taking a long time
body: <p>I have a Symfony2 application that uses Doctrine2 ORM.</p>
  
  <p>I am trying to create entities from an XML file, and then persist the entities. A typical XML file might contain a few thousand records that need to be persisted. Each record in the XML does not map directly onto a single entity, but onto an entity and then some other entities that are on the "many" side of a one-to-many relationship.</p>
  
  <p>I can create the entity from the XML elements, but it comes to running "persist" on the entity, each operation takes around 2 seconds on my machine. With several thousand records being imported from the XML file, this is too slow for our needs.</p>
  
  <p>Could anyone offer any help?</p>