Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Microsoft.Data.Sqlite: Add Default Timeout connection string keyword #23091

Open
wants to merge 2 commits into
base: main
from

Conversation

@nmichels
Copy link
Contributor

@nmichels nmichels commented Oct 24, 2020

Copy link
Member

@bricelam bricelam left a comment

LGTM

@@ -275,6 +275,11 @@ public override void Open()
this.ExecuteNonQuery("PRAGMA recursive_triggers = 1;");
}

if (ConnectionOptions.DefaultTimeout.HasValue)
{
DefaultTimeout = ConnectionOptions.DefaultTimeout.Value;

This comment has been minimized.

@bricelam

bricelam Oct 24, 2020
Member

I think that if the user sets SqliteConnection.DefaultTimeout, it should take precedence. Only fallback to the connection string value when it’s unset.

This comment has been minimized.

@bricelam

bricelam Oct 24, 2020
Member

Also, do we ever use this value when the connection is closed? If so, we may need to read the value in the ConnectionString property setter.

This comment has been minimized.

@nmichels

nmichels Oct 24, 2020
Author Contributor

Hi @bricelam
By unset you mean different from the default value (30)? Or should we implement a private property and explicitly check wheter the DefaultTimeout has changed in it's setter?
I'm not sure, but I think that it doesn't make sense to use this property value when the connection is closed.
Thanks!

This comment has been minimized.

@nmichels

nmichels Oct 24, 2020
Author Contributor

In fact, if we move this code snippet to the ConnectionString property setter we will have the desired precedence in most cases: connection string/default timeout set via constructor and then eventually programatically changed, if the user changes again the connection string it would affect again the Default Timeout, it kinda makes sense.

Nicolas Michels
@bricelam bricelam self-assigned this Oct 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

2 participants
You can’t perform that action at this time.