diff options
-rw-r--r-- | lib/private/DB/Adapter.php | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/private/DB/Adapter.php b/lib/private/DB/Adapter.php index 8f1b8e6d75f..c02220c2442 100644 --- a/lib/private/DB/Adapter.php +++ b/lib/private/DB/Adapter.php @@ -103,7 +103,10 @@ class Adapter { $query .= ' HAVING COUNT(*) = 0'; try { - return $this->conn->executeUpdate($query, $inserts); + $this->conn->beginTransaction(); + $rows = $this->conn->executeUpdate($query, $inserts); + $this->conn->commit(); + return $rows; } catch (UniqueConstraintViolationException $e) { // This exception indicates a concurrent insert happened between // the insert and the sub-select in the insert, which is safe to ignore. |