]> source.dussan.org Git - nextcloud-server.git/commitdiff
Remove beginTransaction, commit, rollback from OC_DB
authorMorris Jobke <hey@morrisjobke.de>
Thu, 7 Jan 2016 09:18:38 +0000 (10:18 +0100)
committerMorris Jobke <hey@morrisjobke.de>
Thu, 7 Jan 2016 13:54:55 +0000 (14:54 +0100)
lib/private/db.php
lib/private/files/cache/scanner.php

index bac0f600e953a7f8098364ebbd3d9afef0b90e71..f5f0c8798cd37f31b7761052238fe3621a7c85b3 100644 (file)
@@ -172,27 +172,6 @@ class OC_DB {
                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
index 983e12d7639d8fec4457da1750a8637974ccbb42..88bb57d2b5c6b3b7816099110d8578b4da49a34b 100644 (file)
@@ -336,7 +336,7 @@ class Scanner extends BasicEmitter {
                $newChildren = $this->getNewChildren($path);
 
                if ($this->useTransactions) {
-                       \OC_DB::beginTransaction();
+                       \OC::$server->getDatabaseConnection()->beginTransaction();
                }
                $exceptionOccurred = false;
                foreach ($newChildren as $file) {
@@ -361,7 +361,7 @@ class Scanner extends BasicEmitter {
                                $exceptionOccurred = true;
                        } catch (\OCP\Lock\LockedException $e) {
                                if ($this->useTransactions) {
-                                       \OC_DB::rollback();
+                                       \OC::$server->getDatabaseConnection()->rollback();
                                }
                                throw $e;
                        }
@@ -372,7 +372,7 @@ class Scanner extends BasicEmitter {
                        $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