]> source.dussan.org Git - nextcloud-server.git/commitdiff
Add a warning when the transaction isolation level is not READ_COMMITED
authorJoas Schilling <nickvergessen@owncloud.com>
Mon, 30 May 2016 10:09:42 +0000 (12:09 +0200)
committerJoas Schilling <nickvergessen@owncloud.com>
Mon, 30 May 2016 10:31:33 +0000 (12:31 +0200)
settings/admin.php
settings/templates/admin.php

index 5bddd4bc5e5a11cf4df400e7b55cec3f56528447..6fb65b013e6ee2e92d1de51857248f029abe8db6 100644 (file)
@@ -103,6 +103,19 @@ $externalBackends = (count($backends) > 1) ? true : false;
 $template->assign('encryptionReady', \OC::$server->getEncryptionManager()->isReady());
 $template->assign('externalBackendsEnabled', $externalBackends);
 
+/** @var \Doctrine\DBAL\Connection $connection */
+$connection = \OC::$server->getDatabaseConnection();
+try {
+       if ($connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\SqlitePlatform) {
+               $template->assign('invalidTransactionIsolationLevel', false);
+       } else {
+               $template->assign('invalidTransactionIsolationLevel', $connection->getTransactionIsolation() !== \Doctrine\DBAL\Connection::TRANSACTION_READ_COMMITTED);
+       }
+} catch (\Doctrine\DBAL\DBALException $e) {
+       // ignore
+       $template->assign('invalidTransactionIsolationLevel', false);
+}
+
 $encryptionModules = \OC::$server->getEncryptionManager()->getEncryptionModules();
 $defaultEncryptionModuleId = \OC::$server->getEncryptionManager()->getDefaultEncryptionModuleId();
 
index 6cf4b43c162cbc0d36f352db1d6d9584a5b73be4..0cdefe1008331d81984d4ab454fc94bc19db50e1 100644 (file)
@@ -97,6 +97,15 @@ if (!$_['isAnnotationsWorking']) {
 <?php
 }
 
+// Is the Transaction isolation level READ_COMMITED?
+if ($_['invalidTransactionIsolationLevel']) {
+       ?>
+       <li>
+               <?php p($l->t('Your database does not run with "READ COMMITED" transaction isolation level. This can cause problems when multiple actions are executed in parallel.')); ?>
+       </li>
+<?php
+}
+
 // Windows Warning
 if ($_['WindowsWarning']) {
        ?>