/**
* Executes a prepared statement within a transaction.
- * CAUTION: Transactions disabled for now, use manual transaction if you like
*
* @param array $parameters
*/
public function execute(array $parameters = array()) {
$this->parameters = $parameters;
$this->database->incrementQueryCount();
- //$this->database->beginTransaction();
try {
if (WCF::benchmarkIsEnabled()) Benchmark::getInstance()->start($this->query, Benchmark::TYPE_SQL_QUERY);
else $this->pdoStatement->execute($parameters);
if (WCF::benchmarkIsEnabled()) Benchmark::getInstance()->stop();
-
- //$this->database->commitTransaction();
}
catch (\PDOException $e) {
- //$this->database->rollBackTransaction();
+ if (WCF::benchmarkIsEnabled()) Benchmark::getInstance()->stop();
+
throw new DatabaseException('Could not execute prepared statement: '.$e->getMessage(), $this->database, $this);
}
}
if (WCF::benchmarkIsEnabled()) Benchmark::getInstance()->stop();
}
catch (\PDOException $e) {
+ if (WCF::benchmarkIsEnabled()) Benchmark::getInstance()->stop();
+
throw new DatabaseException('Could not execute prepared statement: '.$e->getMessage(), $this->database, $this);
}
}