Open Sayan751 opened 4 months ago
It seems that the issue occurs if there are many pending migrations. Here is a reproduction of this issue: https://github.com/Sayan751/efcore-sqlite-issue-34273
The issue also exists for .net 9.0. The reproduction can be found here: https://github.com/Sayan751/efcore-sqlite-issue-34273/tree/net9
Same issue, works on windows but failed on linux container
Ask a question
I am seeing the following error sporadically.
I am using pooled database context and factory. My assumption here is that concurrent write-operations is causing the issue. Or as far as I understand, as the DB is locked during a write-operation, a read-operation at the same, can also cause the issue.
As I cannot deterministically reproduce the issue, I would like to ask if anyone can point me in the direction, to better debug and solve this issue.
Include your code
Program.cs
DatabaseContext.cs
DatabaseMigrationService.cs
As there is another background service that runs tasks periodically (also a
IHostedLifecycleService
, and uses theStartedAsync
hook), any timing conflict during the startup of the service should be avoided.DatabaseConnectionInterceptor.cs
Include stack traces
See above.
Include verbose output
NA
Include provider and version information
EF Core version: 8.0.7 Database provider: Microsoft.EntityFrameworkCore.Sqlite 8.0.7 Target framework: net 8 Operating system: Windows Server IDE: Visual Studio 2022 17.4
Additional details and questions