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

It is impossible to use a user transaction during the migration process #3436

Open
jabacrack opened this issue Jan 21, 2025 · 1 comment
Open
Milestone

Comments

@jabacrack
Copy link

After the latest updates in the documentation, the EF Core team clarified that user transactions can be used in manual migrations with some restrictions:
dotnet/EntityFramework.Docs#4896
https://learn.microsoft.com/en-us/ef/core/what-is-new/ef-core-9.0/breaking-changes#migrations-transaction

However, the NpgsqlHistoryRepository.GetCreateIfNotExistsCommands method, which is called during each Migrator.MigrateAsync execution, sets the SuppressTransaction property to true for every SQL operation. As a result, any migration using an external transaction throws an exception:
"User transaction is not supported with a TransactionSuppressed migration or a retrying execution strategy."

@roji
Copy link
Member

roji commented Jan 21, 2025

I plan to reexamine the strategy here in #3407, will look at this at the same time.

@roji roji added this to the 10.0.0 milestone Jan 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants