You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So exception thrown is correct. If you want to remove upper limit on timeout then call the API with null value. (Null command timeout may not mean infinite time out duration, it may default to connection level time out, someone from @dotnet/efteam can confirm)
An ArgumentException is generated if the assigned CommandTimeout property value is less than 0.
Note to implementers, it is recommended that 0 means no timeout.
However, we've chosen to add an overload in EF Core which accepts a TimeSpan (ADO.NET only has simple ints). Because of this, it does make sense to me to recognize Timeout.InfiniteTimeSpan and handle it properly.
Activity
smitpatel commentedon Jun 9, 2021
Timeout.InfiniteTimeSpanhas value of -1 millisecond. (Ref https://docs.microsoft.com/en-us/dotnet/api/system.threading.timeout.infinitetimespan?view=net-5.0)So exception thrown is correct. If you want to remove upper limit on timeout then call the API with null value. (Null command timeout may not mean infinite time out duration, it may default to connection level time out, someone from @dotnet/efteam can confirm)
bricelam commentedon Jun 9, 2021
-1means infinite on Microsoft.Data.Sqlite. On most other providers you'll probably start hitting network timeouts eventually anyway.-1 means timeout immediately (when another connection has a lock on the object) in Microsoft.Data.Sqlite.
roji commentedon Jun 10, 2021
Note the following in the docs on DbCommand.CommandTimeout:
However, we've chosen to add an overload in EF Core which accepts a TimeSpan (ADO.NET only has simple ints). Because of this, it does make sense to me to recognize Timeout.InfiniteTimeSpan and handle it properly.
Add support for InfiniteTimeSpan in SetCommandTimeout (#25085)