Beispiel #1
0
 /**
  * @return  \Zork\Db\Adapter\Driver\Pdo\PgsqlConnection
  * @throws  UnbalancedNestedTransactionsException
  */
 public function beginTransaction()
 {
     if ($this->isNestableTransactionsEnabled()) {
         $this->checkUnbalancedNestedTransactions();
         if ($this->transactionNestingLevel == 0) {
             parent::beginTransaction();
         } else {
             if (!$this->isConnected()) {
                 $this->connect();
             }
             $this->getResource()->exec('SAVEPOINT zorksavepoint_' . $this->transactionSavepointUniqueId . '_' . $this->transactionNestingLevel);
         }
         $this->transactionNestingLevel++;
         return $this;
     }
     return parent::beginTransaction();
 }