I am using EF Core version 8.0.8 with SQL Server database. Due to recent problems in our IT infrastructure, the database is running slower than usual and we often run into query timeouts. We observed that sometimes when we call SaveChangesAsync
on the DbContext, the call fails with a timeout exception. However, when inspecting the database tables, it seems that all changes were actually saved correctly.
Is this a bug, maybe in the database or in EF? I always thought that no changes are made in the database when SaveChangesAsync
throws an exception.
Or is this the correct behavior and as intended by the EF developers?
Note: This is the exception:
Microsoft.Data.SqlClient.SqlException (0x80131904): Execution Timeout Expired. The timeout period elapsed prior to completion of the operation or the server is not responding.
---> System.ComponentModel.Win32Exception (258): The wait operation timed out.
13