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
TODO
- [x] See how existing tests go
- [ ] Add a test with a example of nested transaction rollback
Checklist
- Code is properly formatted
- Sign-off message is added to all commits
- [ ] Tests (unit, integration, api and/or acceptance) are included
- [ ] Screenshots before/after for front-end changes
- [ ] Documentation (manuals or wiki) has been updated or is not required
- [ ] Backports requested where applicable (ex: critical bugfixes)
:eyes: @nickvergessen
https://www.doctrine-project.org/projects/doctrine-dbal/en/current/reference/transactions.html#transaction-nesting
Nesting transactions without savepoints is deprecated, but is the default behavior for backward compatibility reasons.
Since we are bumping the major mostlikely with 28 anyway, I'm fine with queuing it for that release.
Since we are bumping the major mostlikely with 28 anyway, I'm fine with queuing it for that release
showtime?
Rebased