Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

set Doctrine to use nest transactions with savepoints #39589

Merged
merged 1 commit into from
May 27, 2024

Conversation

tcitworld
Copy link
Member

@tcitworld tcitworld commented Jul 27, 2023

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
#36528 (comment) (and possibly) #38902 (comment)

TODO

  • See how existing tests go
  • Add a test with a example of nested transaction rollback

Checklist

@tcitworld tcitworld added this to the Nextcloud 28 milestone Jul 27, 2023
@ChristophWurst
Copy link
Member

👀 @nickvergessen

@nickvergessen
Copy link
Member

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
Copy link
Member

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

@ChristophWurst
Copy link
Member

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

showtime?

@tcitworld tcitworld force-pushed the enh/set-nest-transactions-with-savepoints branch from 0f43b5c to 72e1eec Compare October 6, 2023 06:14
@skjnldsv skjnldsv mentioned this pull request Nov 1, 2023
This was referenced Nov 6, 2023
This was referenced Nov 14, 2023
@blizzz blizzz modified the milestones: Nextcloud 28, Nextcloud 29 Nov 23, 2023
@tcitworld tcitworld added 3. to review Waiting for reviews and removed 2. developing Work in progress labels Feb 1, 2024
@tcitworld tcitworld force-pushed the enh/set-nest-transactions-with-savepoints branch from 72e1eec to 73b4bd1 Compare February 1, 2024 17:45
@tcitworld
Copy link
Member Author

Rebased

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
#36528 (comment)
(and possibly) #38902 (comment)

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
@AndyScherzinger AndyScherzinger force-pushed the enh/set-nest-transactions-with-savepoints branch from 73b4bd1 to 2a08154 Compare February 27, 2024 13:27
This was referenced Mar 12, 2024
This was referenced Mar 20, 2024
@skjnldsv skjnldsv mentioned this pull request Mar 28, 2024
81 tasks
@skjnldsv skjnldsv modified the milestones: Nextcloud 29, Nextcloud 30 Mar 28, 2024
@tcitworld tcitworld merged commit b0f5c75 into master May 27, 2024
161 checks passed
@tcitworld tcitworld deleted the enh/set-nest-transactions-with-savepoints branch May 27, 2024 14:53
@blizzz blizzz mentioned this pull request Jul 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. to review Waiting for reviews enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants