aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorThomas Citharel <tcit@tcit.fr>2023-07-27 11:30:43 +0200
committerAndy Scherzinger <info@andy-scherzinger.de>2024-02-27 14:27:11 +0100
commit2a0815401e6f56544f1c995a3519589cb678da6b (patch)
tree86688bc00ebd69d2d490db97fba4d228abbbf6c9 /lib
parent250084f8b913e326e20ccc60c86091beab0a6524 (diff)
downloadnextcloud-server-2a0815401e6f56544f1c995a3519589cb678da6b.tar.gz
nextcloud-server-2a0815401e6f56544f1c995a3519589cb678da6b.zip
feat(db): set Doctrine to use nest transactions with savepoints
Using nested transactions without savepoints is actually deprecated by Doctrine: https://www.doctrine-project.org/projects/doctrine-dbal/en/current/reference/transactions.html#transaction-nesting Without savepoints, a nested transaction can be rollbacked but not handled properly in the "real" transaction, leading to the following error: Transaction commit failed because the transaction has been marked for rollback only. Ref https://github.com/nextcloud/server/pull/36528#issuecomment-1639913965 (and possibly) https://github.com/nextcloud/server/issues/38902#issuecomment-1598075391 Signed-off-by: Thomas Citharel <tcit@tcit.fr>
Diffstat (limited to 'lib')
-rw-r--r--lib/private/DB/Connection.php2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/private/DB/Connection.php b/lib/private/DB/Connection.php
index a8838bbae2c..86012ba4712 100644
--- a/lib/private/DB/Connection.php
+++ b/lib/private/DB/Connection.php
@@ -127,6 +127,8 @@ class Connection extends PrimaryReadReplicaConnection {
$this->dbDataCollector->setDebugStack($debugStack);
$this->_config->setSQLLogger($debugStack);
}
+
+ $this->setNestTransactionsWithSavepoints(true);
}
/**