Improved insert speed on default MySQL setups
authorAlexander Ebert <ebert@woltlab.com>
Sat, 31 Jan 2015 21:52:54 +0000 (22:52 +0100)
committerAlexander Ebert <ebert@woltlab.com>
Sat, 31 Jan 2015 21:52:54 +0000 (22:52 +0100)
wcfsetup/install/files/lib/system/package/PackageUpdateDispatcher.class.php

index 5cba4d84e4b3fab99ef060dcc207f3f0d4a4cdec..6fa770eb22129d59b94afd75911a2dba55fc2f7e 100644 (file)
@@ -324,6 +324,7 @@ class PackageUpdateDispatcher extends SingletonFactory {
        protected function savePackageUpdates(array &$allNewPackages, $packageUpdateServerID) {
                // insert updates
                $excludedPackagesParameters = $fromversionParameters = $insertParameters = $optionalInserts = $requirementInserts = array();
+               WCF::getDB()->beginTransaction();
                foreach ($allNewPackages as $identifier => $packageData) {
                        // create new database entry
                        $packageUpdate = PackageUpdateEditor::create(array(
@@ -402,6 +403,7 @@ class PackageUpdateDispatcher extends SingletonFactory {
                                }
                        }
                }
+               WCF::getDB()->commitTransaction();
                
                // save requirements, excluded packages and fromversions
                // insert requirements