Exemplo n.º 1
0
 /**
  * Commit transaction
  * @return bool
  */
 protected function _commit()
 {
     if ($this->_nestedTransactionsCounter <= 0) {
         throw new Zend_Db_Adapter_Exception('Nested transactions error');
     }
     if ($this->_isInRollback) {
         throw new Zend_Db_Adapter_Exception('Cannot commit while in rollback mode');
     }
     $this->_nestedTransactionsCounter--;
     if ($this->_nestedTransactionsCounter == 0) {
         return parent::_commit();
     }
     return true;
 }
Exemplo n.º 2
0
 /**
  * Decrease transaction counter and issue commit.
  *
  * @return bool True
  */
 protected function _commit()
 {
     if ($this->_runningTransactions < 2) {
         // Check for values < 2 to not mask errors on misuse of commit()
         $query = $this->getProfiler()->queryStart('real_COMMIT', Zend_Db_Profiler::TRANSACTION);
         parent::_commit();
         $this->getProfiler()->queryEnd($query);
     }
     $this->_runningTransactions--;
     return true;
 }