-
Notifications
You must be signed in to change notification settings - Fork 96
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
New-NAVEnvironment do not close SQL connection ? #40
Labels
Comments
thanks for mentioning! Do you have a repro for me? Like a (small) script to test this out? |
Hi,
Here is the script I’m Trying to execute :
My exe Build is greater than the backup file’s one and conversion is needed. So it’s normal for me that service does not start after environment creation, and I wanted to launch conversion and synch in same script.
$BckpFile = "Demo Database NAV (10-0) - FR - Cu4.bak"
$Server = "Localhost"
$InstanceSQL = "SQL2016"
$DatabasePath = 'D:\Databases\MSSQL13.SQL2016\MSSQL\Data'
$DatabaseName = "ConvTest"
New-NAVEnvironment -BackupFile $BckpFile -ClientServicesPort 7046 -CreateWebServerInstance -DatabaseInstance $InstanceSQL -Databasename $DatabaseName -DatabaseServer $Server -EnablePortSharing -ManagementServicesPort 7045 -ServerInstance $DatabaseName
Invoke-NAVDatabaseConversion -DatabaseName $DatabaseName -DatabaseServer ($Server + '\' + $InstanceSQL)
Set-NAVServerInstance -Start -ServerInstance $DatabaseName
Sync-NAVTenant -ServerInstance $DatabaseName -Force -Mode ForceSync
I don’t matter service starting errors, but this one is annoying :
Invoke-NAVDatabaseConversion : : [22924111] The ConvTest database on the xxxxxxxxxx\SQL2016 server must be converted before you can use it with this version of the
Microsoft Dynamics NAV Development Environment.
The database conversion cannot continue because there are other SQL Server sessions using the database.
Close all other sessions and then try again.
Au caractère D:\Users\xxxxxxxxx\Documents\Scripts\Repro Waldo.ps1:11 : 1
+ Invoke-NAVDatabaseConversion -DatabaseName $DatabaseName -DatabaseSer ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException
+ FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Invoke-NAVDatabaseConversion
If I close PowerShell ISE and then reopen to execute script again with comment on New-NAVEnvironment line, conversion and synch work fine. I supposed then that open SQL connection was about database restore or rights modifications within New-NAVEnvironment
Regards.
De : waldo [mailto:[email protected]]
Envoyé : jeudi 7 septembre 2017 09:55
À : waldo1001/Cloud.Ready.Software.PowerShell <[email protected]>
Cc : AcererakTheLich <[email protected]>; Author <[email protected]>
Objet : Re: [waldo1001/Cloud.Ready.Software.PowerShell] New-NAVEnvironment do not close SQL connection ? (#40)
thanks for mentioning!
Do you have a repro for me? Like a (small) script to test this out?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub<#40 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AdohJsecusIKgxcB1WnBSlxJqUgrhS7Oks5sf6E2gaJpZM4POFnA>.
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi,
I'm not sure but it seems New-NAVEnvironment function does not close opened SQL connections once execution is done.
For example I tried to create a script by using this function followed by invoking database conversion and synch tables (newer build on development environment), but an error about non exclusive connection is always raised.
Closing and reopen PS ISE to launch again only convertion and Synch works fine.
The text was updated successfully, but these errors were encountered: