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

[sqlserver] Close database connections #1997

Merged
merged 1 commit into from Oct 26, 2015
Merged

Conversation

JohnLZeller
Copy link
Contributor

If we leave database connections open it can cause the SQL Server Agent to hang when attempting to stop.

@@ -190,6 +192,22 @@ def _conn_string(self, instance):
conn_str += 'Integrated Security=SSPI;'
return conn_str

def _conn_key_to_string(self, conn_key):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can't we just add that to the _conn_string method? We could change it to _conn_string(self, **kwargs) and get the DB info with either self._get_access_info(instance) or conn_key depending on what's in **kwargs.

If we can avoid duplicating code that would be great!

@JohnLZeller
Copy link
Contributor Author

@hkaj I chose to modify the _conn_string function to explicitly refer to the 2 possibilities instead. Let me know what you think

@hkaj
Copy link
Member

hkaj commented Oct 26, 2015

lgtm

JohnLZeller added a commit that referenced this pull request Oct 26, 2015
[sqlserver] Open/Close database connections
@JohnLZeller JohnLZeller merged commit 34632ac into master Oct 26, 2015
@JohnLZeller JohnLZeller deleted the zeller/sqlserver-close branch October 26, 2015 20:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants