]> source.dussan.org Git - nextcloud-server.git/commitdiff
Add missing DB rollback functionality
authorDan Bartram <daneybartram@gmail.com>
Fri, 24 Oct 2014 16:44:06 +0000 (17:44 +0100)
committerDan Bartram <daneybartram@gmail.com>
Fri, 24 Oct 2014 16:44:06 +0000 (17:44 +0100)
lib/private/db.php
lib/public/db.php

index 9b904a1518f52c895dec682515cdb4b20d426bfd..b820281b8a3f3375362baebbd9130284d725c281 100644 (file)
@@ -204,6 +204,13 @@ class OC_DB {
                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 ba3a4724ce012fe3ad13d24bfe2afbf44f1462e6..e8fc817106e96d7466531c719ee61600dfb9a5f5 100644 (file)
@@ -96,6 +96,13 @@ class DB {
                \OC_DB::commit();
        }
 
+       /**
+        * Rollback the database changes done during a transaction that is in progress
+        */
+       public static function rollback() {
+               \OC_DB::rollback();
+       }
+
        /**
         * Check if a result is an error, works with Doctrine
         * @param mixed $result