function getInstanceIWish(IConnection $connection) { $connectionString = (string) $connection; foreach ($this->pool as $k => $p) { if ((string) $p == $connectionString) { unset($this->pool[$k]); //echo "Recycled Connection\r\n"; return $p; } } //echo "New Connection\r\n"; return $connection->toInstance(); }
function transactionRollback() { $result = $this->adapter->rollback(); $this->transactionManager->inTransaction = false; if (!$result) { throw new TransactionException("Transaction ROLLBACK failed"); } $this->transactionManager->handleOnRollback(); $this->transactionManager->clearAfterCommitOrRollback(); }