Skip to content

Commit

Permalink
Wrap multiple inserts inside a transation
Browse files Browse the repository at this point in the history
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
  • Loading branch information
CarlSchwan committed Feb 3, 2022
1 parent 6ae91d6 commit 810efb3
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions apps/dav/lib/CardDAV/CardDavBackend.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -1284,6 +1286,7 @@ protected function updateProperties($addressBookId, $cardUri, $vCardSerialized)
$query->setParameter('preferred', $preferred);
$query->execute();
}
$this->db->commit();
}

/**
Expand Down

0 comments on commit 810efb3

Please sign in to comment.