title: 500 error caused by Doctrine 2 DBAL query
body: <p>I have this query:</p>
  
  <pre><code>public function warnBelowCostPrices(Application $app) {
          $em = $app['orm.em'];
  
          ini_set('xdebug.var_display_max_depth', 3);
          ini_set('xdebug.var_display_max_data', 40);
  
          try {
          //basic option check
          $optionQuery = $em-&gt;createQuery('
              SELECT o FROM m:Option o JOIN m:Product p
              WHERE o.costPriceVariation &gt; 0 AND o.price &gt; 0 AND o.stock &gt; 0
              AND (o.costPriceVariation &gt;= o.price OR p.costPrice &gt;= o.price)
          ');
          $options = $optionQuery-&gt;getResult();
          //var_dump($options);
          } catch (\Exception $e) {
              var_dump($e);
              die();
      }
  </code></pre>
  
  <p>Which is causing a 500 error. This is the only code executed in the call I am testing and nothing appears in the logs.</p>
  
  <p>Can anyone see why this would occur?</p>