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

DbMigrator running occurred warning in 4.1.0-rc.2 #6819

Closed
gerryge opened this issue Dec 25, 2020 · 3 comments · Fixed by #6912
Closed

DbMigrator running occurred warning in 4.1.0-rc.2 #6819

gerryge opened this issue Dec 25, 2020 · 3 comments · Fixed by #6912
Assignees
Milestone

Comments

@gerryge
Copy link
Contributor

gerryge commented Dec 25, 2020

Abp version 4.1.0-rc.2
User Interface: MVC
Database provider: EF Core

How to reproduce:

  1. Run cmd "abp new Acme.BookStore --preview"
  2. Run Acme.BookStore.DbMigrator and warning occurred

I changed the MultipleActiveResultSets in Default connection from true to false, then the warning disappeared.
"Default": "Server=(LocalDb)\MSSQLLocalDB;Database=BookStore;Trusted_Connection=True;MultipleActiveResultSets=true"
I also tried the v3.3.2 and v4.0.2 start templates, there's no this warning even MultipleActiveResultSets value is true.

Below is the detail info, I would like to know why this happened, Thank you.

[18:03:50 WRN] Savepoints are disabled because Multiple Active Result Sets (MARS) is enabled. If 'SaveChanges' fails, then the transaction cannot be automatically rolled back to a known clean state. Instead, the transaction should be rolled back by the application before retrying 'SaveChanges'. See https://go.microsoft.com/fwlink/?linkid=2149338 for more information. To identify the code which triggers this warning, call 'ConfigureWarnings(w => w.Throw(RelationalEventId.SavepointsDisabledBecauseOfMARS))'.

image

@maliming maliming self-assigned this Dec 28, 2020
@maliming maliming added this to the 4.2-preview milestone Dec 28, 2020
@real-zony
Copy link
Contributor

real-zony commented Dec 29, 2020

Hi @gerryge, This warning was introduced in EF Core 5.0.1.(abp 4.1.x) For details, please refer to

@maliming
Copy link
Member

@GameBelial Should we remove MultipleActiveResultSets=true in ConnectionStrings?

@real-zony
Copy link
Contributor

@maliming This problem is caused by the introduction of the SavePoint feature in EF Core 5.0.1, which is the default behavior in EF Core 5.0.1. I think in our default template, MultipleActiveResultSets=true should be removed (for SQL Server).
If you need to disable the SavePoint feature, you can refer to this Issue (dotnet/efcore#23269).

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

Successfully merging a pull request may close this issue.

3 participants