Skip to content

Commit b68d637

Browse files
committed
Strip the transactions
These were used as a performance improvement in old MySQL versions and are not really needed anymore. Plus they make it more likely to run into deadlocks when used with large numbers of recipients. See https://www.woltlab.com/community/thread/314371/
1 parent f6ee581 commit b68d637

File tree

1 file changed

+0
-4
lines changed

1 file changed

+0
-4
lines changed

wcfsetup/install/files/lib/data/user/notification/UserNotificationAction.class.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,15 +56,13 @@ public function createDefault()
5656
VALUES (?, ?, ?)";
5757
$statement = WCF::getDB()->prepare($sql);
5858

59-
WCF::getDB()->beginTransaction();
6059
foreach ($notifications as $notificationData) {
6160
$statement->execute([
6261
$notificationData['object']->notificationID,
6362
$this->parameters['authorID'] ?: null,
6463
TIME_NOW,
6564
]);
6665
}
67-
WCF::getDB()->commitTransaction();
6866

6967
return $notifications;
7068
}
@@ -128,7 +126,6 @@ public function createStackable()
128126
WHERE notificationID = ?";
129127
$triggerStatement = WCF::getDB()->prepare($sql);
130128

131-
WCF::getDB()->beginTransaction();
132129
$notificationIDs = [];
133130
foreach ($notifications as $notificationData) {
134131
$notificationIDs[] = $notificationData['object']->notificationID;
@@ -144,7 +141,6 @@ public function createStackable()
144141
$notificationData['object']->notificationID,
145142
]);
146143
}
147-
WCF::getDB()->commitTransaction();
148144

149145
$notificationList = new UserNotificationList();
150146
$notificationList->setObjectIDs($notificationIDs);

0 commit comments

Comments
 (0)