return \OC::$server->getDatabaseConnection()->lastInsertId($table);
}
- /**
- * Start a transaction
- */
- public static function beginTransaction() {
- return \OC::$server->getDatabaseConnection()->beginTransaction();
- }
-
- /**
- * Commit the database changes done during a transaction that is in progress
- */
- public static function commit() {
- return \OC::$server->getDatabaseConnection()->commit();
- }
-
- /**
- * Rollback the database changes done during a transaction that is in progress
- */
- public static function rollback() {
- return \OC::$server->getDatabaseConnection()->rollback();
- }
-
/**
* saves database schema to xml file
* @param string $file name of file
$newChildren = $this->getNewChildren($path);
if ($this->useTransactions) {
- \OC_DB::beginTransaction();
+ \OC::$server->getDatabaseConnection()->beginTransaction();
}
$exceptionOccurred = false;
foreach ($newChildren as $file) {
$exceptionOccurred = true;
} catch (\OCP\Lock\LockedException $e) {
if ($this->useTransactions) {
- \OC_DB::rollback();
+ \OC::$server->getDatabaseConnection()->rollback();
}
throw $e;
}
$this->removeFromCache($child);
}
if ($this->useTransactions) {
- \OC_DB::commit();
+ \OC::$server->getDatabaseConnection()->commit();
}
if ($exceptionOccurred) {
// It might happen that the parallel scan process has already