I have been having a problem with a query against a SQL Server database timing out after 30 seconds. To address this I am now setting the Command timeout. However, I am still receiving a timeout exception after 30 seconds.
If this code is executed when SelectAsync is called and since I call SetCommandTimeout() on the connection then it seems that CommandTimeout that I have just set should be used and not the OrmLiteConfig default?
OK - I’ve cloned the repo and written a test and, by stepping through the code, can see that even though I am calling SetCommandTimeout(180) the actual command timeout is being taken from OrmLiteConfig.CommandTimeout i.e. 30 seconds.
Can I ask in what cases does SetCommandTimeout have an effect?
public async Task Can_Set_CommandTimeout()
using (var db = OpenDbConnection())