diff options
author | Joas Schilling <nickvergessen@gmx.de> | 2016-05-31 17:11:51 +0300 |
---|---|---|
committer | Thomas Müller <DeepDiver1975@users.noreply.github.com> | 2016-05-31 17:11:51 +0300 |
commit | 9070fd2c03c2c922065baa7cd903ed6e97c2d514 (patch) | |
tree | 31c97fc66ac72e8dd500ee33c00316b19c768b2d /settings | |
parent | 95cdbd45b852b4b1bc5c872599d375e70de24884 (diff) |
Add a warning when the transaction isolation level is not READ_COMMITED (#24915)
Diffstat (limited to 'settings')
-rw-r--r-- | settings/admin.php | 13 | ||||
-rw-r--r-- | settings/templates/admin.php | 9 |
2 files changed, 22 insertions, 0 deletions
diff --git a/settings/admin.php b/settings/admin.php index e0d3a907f47..42ca7e3525f 100644 --- a/settings/admin.php +++ b/settings/admin.php @@ -100,6 +100,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(); diff --git a/settings/templates/admin.php b/settings/templates/admin.php index 2f4461589da..616ac2ab852 100644 --- a/settings/templates/admin.php +++ b/settings/templates/admin.php @@ -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']) { ?> |