-
Notifications
You must be signed in to change notification settings - Fork 21
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
$SqlConnection.Close() not in a finally block #124
Comments
Hi @rancourt-martin , |
Hi Martin, |
Good stuff,
Really appreciate the feedback
Martin
…__________
Martin Rancourt
514.567.1297
Le 10 nov. 2023 à 17:58, Vlad Drumea ***@***.***> a écrit :
I've added another pair of $SqlConnection.Close() and $SqlConnection.Dispose() (there already is a $SqlConnection.Dispose() at the begging of the finally block), but the connection still remains after script PSBlitz execution finishes.
The good news is that closing the PowerShell window from which PSBlitz was executed causes the leftover connection to close immediately
—
Reply to this email directly, view it on GitHub<#124 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AONZ7WOY2DNDONBB4ZEIZFDYD2WQHAVCNFSM6AAAAAA6YC3PS2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMBWGUZTQMJTGQ>.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
Hi,
(amazing piece of code that saved me weeks of back and forth with a client)
fyi, I ran into the case where after completion of psblitz, connection is not closed and lingers on the sqlserver. we suspect this is caused by the $SqlConnection.Close() (or dispose) not being in a "finally" block.
The text was updated successfully, but these errors were encountered: