title: PDO There is no active transaction
body: <p>One of my class files has been spitting out the "There is no active transaction" warning when creating some records. It is the only one doing it and I can't figure out why because all my queries are executing successfully.</p>
  
  <p>My php_errors log has given me zero insight to the issue, nor have any of the other related questions provided any solutions.</p>
  
  <pre><code>    try {
          App::$DB-&gt;beginTransaction();
  
          $rQuery = App::$DB-&gt;prepare("INSERT INTO `Cervidae` (`".implode('`, `',array_keys($aSQL))  ."`) VALUES (".implode(",",$aPlaceholders).")");
          $rQuery-&gt;execute(array_values($aSQL));
  
          $this-&gt;_Cervid_ID = App::$DB-&gt;lastInsertId();
  
          if (is_array($aData["Treatments"])) {
              foreach ($aData["Treatments"] as $sTreatmentName =&gt; $sTreatmentData) {
                  $oTreatmentToCervid = new TreatmentToCervid(array("Treatment_ID" =&gt; $sTreatmentData["Treatment_ID"], "Cervid_ID" =&gt; $this-&gt;_Cervid_ID, "CreatedBy" =&gt; $aSQL["CreatedBy"], "UpdatedBy" =&gt; $aSQL["UpdatedBy"], "Dose" =&gt; $sTreatmentData["TreatmentDose"]), "NEW");
              }
          }
  
          $oHerdSize = App::getFlat(self::get(array("COUNT(Cervidae.Cervid_ID) AS HerdSize"),array("Cervidae.Herd_ID = $nHerdID","Cervidae.IsActive = 1")));
          $rQuery = App::$DB-&gt;prepare("UPDATE `Herds` SET `HerdSize` = ".$oHerdSize-&gt;HerdSize." WHERE `Herd_ID` = ".$nHerdID);
          $rQuery-&gt;execute();
  
          App::$DB-&gt;commit();
  
          $this-&gt;__construct($this-&gt;_Cervid_ID, 'ID');
  
      }
      catch (Exception $e) {
          App::$DB-&gt;rollBack();
          throw new Exception($e-&gt;getMessage());
      }
  </code></pre>