title: How to profile Doctrine in Zend Framework
body: <p>Good day.</p>
  
  <p>I'm using Doctrine as ORM for my Zend Framework project. This is the first time I use it. I've followed the ZendCasts Doctrine chapters, and everything works for me, but I needed to perform some profiling;</p>
  
  <p>There is a Doctrine_Connection_Profiler class that should be used to profile the Doctrine Model internal queries, but I've tried to use it without success. I always get a "PDOException: You cannot serialize or unserialize PDOStatement instances" exception when I perform my Unit Tests.</p>
  
  <p>Here is a example:</p>
  
  <pre><code>$conn = Doctrine_Manager::connection($doctrineConfig['dsn'], $dbconfname);
  ...
  if( APPLICATION_ENV != 'production'){
      $obj_doctrine_profiler = new Doctrine_Connection_Profiler();
      $conn-&gt;setListener($obj_doctrine_profiler);
  }
  </code></pre>
  
  <p>All of my Unit Tests works if I comment/delete the </p>
  
  <pre><code>$conn-&gt;setListener($obj_doctrine_profiler);
  </code></pre>
  
  <p>line. This code block is located in my Bootstrap.php class; the weird thing is, the web application works just fine even with the mentioned code line.</p>
  
  <p>Thank you so much for your help.</p>
  
  <p>please excuse me if my english is not the best.</p>