server icon indicating copy to clipboard operation
server copied to clipboard

set Doctrine to use nest transactions with savepoints

Open tcitworld opened this issue 2 years ago • 5 comments

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

tcitworld avatar Jul 27 '23 10:07 tcitworld

:eyes: @nickvergessen

ChristophWurst avatar Aug 08 '23 07:08 ChristophWurst

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.

nickvergessen avatar Aug 08 '23 07:08 nickvergessen

Since we are bumping the major mostlikely with 28 anyway, I'm fine with queuing it for that release.

nickvergessen avatar Aug 08 '23 07:08 nickvergessen

Since we are bumping the major mostlikely with 28 anyway, I'm fine with queuing it for that release

showtime?

ChristophWurst avatar Oct 06 '23 05:10 ChristophWurst

Rebased

tcitworld avatar Feb 01 '24 17:02 tcitworld