Closed andreasjordan closed 1 day ago
Import-DbaCsv
has the same problems - because it uses Connect-DbaInstance
with -StatementTimeout 0
. That forces a .ConnectionContext.Copy()
and that does not work with a token.
Will try to find a good solution for all of those commands.
No, it's $connContext.GetDatabaseConnection($Database)
that is the problem. Will have to test if this is needed...
OK, I have to do more tests. Will do this in the next days...
Not .GetDatabaseConnection($Database)
is the problem, but .ConnectionContext.Copy()
. This creates a new connection which fails in case the original connection was opened using AccessToken.
Bottom line: $server
from $server = Connect-DbaInstance ... -AccessToken
must not be changed by any Connect-DbaInstance
inside of our commands.
Thank you, will take some time to review this one
Well it wont take a long time, just will check it out more deeply tomorrow 😅
im happy to merge this but how will we handle timeouts? i imagine the timeouts were adding for expected long-running queries. should we advise updating their configs?
And thank you 🙏🏼
As StatementTimeout 0 was and is the default, there are no timeouts. So nothing was changed an that side and there should not be a problem.
Type of Change
.\tests\manual.pester.ps1
)See issue for details.
Also included in this pull request:
StatementTimeout 0
as they are the default anyway.