Command timeout not working with sqlite #18607
Labels
closed-fixed
The issue has been fixed and is/will be included in the release indicated by the issue milestone.
customer-reported
type-bug
Milestone
I can't get
builder.UseSqlite("", opts => opts.CommandTimeout(60))
norDbContext.Database.SetCommandTimeout(60)
to work with sqlite. The commands always timeout after 30 seconds, no matter what I provide as command timeout value.Steps to reproduce
Run the below code with
dotnet run
.Microsoft.Data.Sqlite.SqliteException: SQLite Error 5: 'database is locked'.
is always throw as expected, but elapsed time is always 30 seconds no matter what the timeout is set to. The same goes when settings timeout usingSetCommandTimeout
.Terminal output.
Creating a
SqliteConnection
manually and settingDefaultTimeout
seems to work.The timeout exception is thrown after 60 seconds as expected.
Further technical details
EF Core version: 2.2.6
Database provider: Microsoft.EntityFrameworkCore.Sqlite
Target framework: .NET Core 2.2
Operating system: macOS 10.14.6
IDE: Visual Studio Code 1.39.2
The text was updated successfully, but these errors were encountered: