title: Symfony2 get error code for flush function
body: <p>I am using Symfony and creating a soft with 3 tiers (client, apache, mysql). So I don't know how to get the statut when the symfony application persists and flushs something?</p>
  
  <p>When I add something in database I display an alert like "Add done!" but if my database is down I will display "Add done" despite the fail...</p>
  
  <p>So how can I get the statut of these functions (flush/persist)? How can I change my alert switch the statut?</p>
  
  <p>Best regards,</p>