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
{{ message }}
Repository navigation
Is it possible to add keyword "Command Timeout" to the connection string #614
Right now the only way to override default value of SqlCommand.CommandTimeout is to do this in code.
It would be nice to do this through connection string/ConnectionStringBuilder/Connection.
Reacted by Cheena Malhotra, Daniel Smith, Erik Ejlskov Jensen, Brice Lambson and Giorgi Chakhidze
In Npgsql, the programmatic NpgsqlCommand.CommandTimeout takes precedence over the connection string parameter - as a general rule, programmatic access always overrides connection string parameters (as they can be more specific).
Reacted by Erik Ejlskov Jensen and Cheena Malhotra
I will look into it, I think it would be a very welcome addition, in particular if you are using some library on top of ADO.NET, where it may not be possible for you as a library consumer to modify the command timeout.
Activity
cheenamalhotra commentedon Jun 18, 2020
Hi @Georgy-Losenkov
I believe it should be possible, we'll keep that noted for future enhancements.
roji commentedon Jun 19, 2020
For reference, Npgsql has this.
ErikEJ commentedon Aug 30, 2020
Would you consider a community PR for this?
ErikEJ commentedon Aug 30, 2020
@roji Can you point me to how you are prioritizing CommandTimeout set via the Connection string vs CommanTimeout set in code?
roji commentedon Aug 30, 2020
In Npgsql, the programmatic NpgsqlCommand.CommandTimeout takes precedence over the connection string parameter - as a general rule, programmatic access always overrides connection string parameters (as they can be more specific).
ErikEJ commentedon Aug 30, 2020
@roji Thanks! Will try the same with SqlCommand. Nice #regions 😁
ErikEJ commentedon Aug 31, 2020
API proposal:
SqlCommand will use same precedence logic as here
cheenamalhotra commentedon Aug 31, 2020
@ErikEJ That would be great!
As for us, it isn't in the top priority list as of now.
ErikEJ commentedon Aug 31, 2020
I will look into it, I think it would be a very welcome addition, in particular if you are using some library on top of ADO.NET, where it may not be possible for you as a library consumer to modify the command timeout.