From: Thomas Müller Date: Wed, 23 Jul 2014 18:13:19 +0000 (+0200) Subject: only commit in case a transaction is active X-Git-Tag: v7.0.1RC1^2~42 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=303e504fcbd9b4b017a0774a62a0e9b65b24b6c8;p=nextcloud-server.git only commit in case a transaction is active --- diff --git a/lib/private/db/migrator.php b/lib/private/db/migrator.php index 6443cf4ed48..d05f8455551 100644 --- a/lib/private/db/migrator.php +++ b/lib/private/db/migrator.php @@ -110,7 +110,9 @@ class Migrator { $this->dropTable($tmpName); } catch (DBALException $e) { // pgsql needs to commit it's failed transaction before doing anything else - $this->connection->commit(); + if ($this->connection->isTransactionActive()) { + $this->connection->commit(); + } $this->dropTable($tmpName); throw new MigrationException($table->getName(), $e->getMessage()); }