From 810efb32082c69b3b7be96c0330d3443b6aeae8e Mon Sep 17 00:00:00 2001 From: Carl Schwan Date: Thu, 3 Feb 2022 21:41:17 +0100 Subject: [PATCH] Wrap multiple inserts inside a transation Signed-off-by: Carl Schwan --- apps/dav/lib/CardDAV/CardDavBackend.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/apps/dav/lib/CardDAV/CardDavBackend.php b/apps/dav/lib/CardDAV/CardDavBackend.php index 4d4b605de6dbc..605799caabaa0 100644 --- a/apps/dav/lib/CardDAV/CardDavBackend.php +++ b/apps/dav/lib/CardDAV/CardDavBackend.php @@ -1268,6 +1268,8 @@ protected function updateProperties($addressBookId, $cardUri, $vCardSerialized) ] ); + + $this->db->beginTransaction(); foreach ($vCard->children() as $property) { if (!in_array($property->name, self::$indexProperties)) { continue; @@ -1284,6 +1286,7 @@ protected function updateProperties($addressBookId, $cardUri, $vCardSerialized) $query->setParameter('preferred', $preferred); $query->execute(); } + $this->db->commit(); } /**