From: Dan Bartram Date: Fri, 24 Oct 2014 16:44:06 +0000 (+0100) Subject: Add missing DB rollback functionality X-Git-Tag: v8.0.0alpha1~442^2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=9c1015b790560439b039c0cf7e162b316fe3a2f7;p=nextcloud-server.git Add missing DB rollback functionality --- diff --git a/lib/private/db.php b/lib/private/db.php index 9b904a1518f..b820281b8a3 100644 --- a/lib/private/db.php +++ b/lib/private/db.php @@ -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 diff --git a/lib/public/db.php b/lib/public/db.php index ba3a4724ce0..e8fc817106e 100644 --- a/lib/public/db.php +++ b/lib/public/db.php @@ -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