EducationSoftwareStrategy.com
StrategyCommunity

Knowledge Base

Product

Community

Knowledge Base

TopicsBrowse ArticlesDeveloper Zone

Product

Download SoftwareProduct DocumentationSecurity Hub

Education

Tutorial VideosSolution GalleryEducation courses

Community

GuidelinesGrandmastersEvents
x_social-icon_white.svglinkedin_social-icon_white.svg
Strategy logoCommunity

© Strategy Inc. All Rights Reserved.

LegalTerms of UsePrivacy Policy
  1. Home
  2. Topics

KB16442: How to close user connections when using the Microstrategy Intelligence Server SDK 9.x


Community Admin

• Strategy


Users might notice that when running Strategy Intelligence Server 9.x code, the Connections Monitor shows a large number of connections that were not properly closed even after trying to close them in the code, as shown below:
 

ka04W000000OewxQAC_0EM440000002Gyy.jpeg

 
When creating a connection to Strategy Intelligence Server 9.x using Strategy SDK 9.x, two connections are created programmatically, one at the server level 'MyDataSource' and one at the project level 'MyProject'.
 



 

'log in to Project Source MyDataSource.AuthMode = DssAuthStandard MyDataSource.login = "administrator" MyDataSource.Passwd = "" MyDataSource.Type = EnumDSSDataSourceType.DssDataSourceTypeServer MyDataSource.Mode = EnumDSSConnectionMode.DssConnectionModeServerAccess MyDataSource.Location = "localhost" MyDataSource.Port = 34952 MyDataSource.Init 'Find the project Set MyProjectList = MyDataSource.Enumerator Set MyProject = MyProjectList.ItemByProjectName("Strategy Tutorial") MyProject.Init
 
In order to disconnect correctly when the code is done executing, both connections need to be terminated:
 
In VB6


 

Set objSource = Nothing MyProject.Reset Set MyProject = Nothing MyDataSource.Reset Set MyDataSource = Nothing MySession.Close Set MySession = Nothing
 
 
Note: The session object should be the last to be closed otherwise there will always be one connection left out open.
 
 
Using C#
 


 

finally { if (MySession != null){ MyProject.Reset(); MyProject = null; MyDataSource.Reset(); MyDataSource = null; MySource = null; //Close session MySession.Close(); MySession = null; } }
 
WARNING MESSAGE:
Customization Code Warning:
This customization is provided as a convenience to Strategy users and is only directly applicable to the version stated. While this code may apply to other releases directly, Strategy Technical Support makes no guarantees that the code provided will apply to any future or previous builds. In the event of a code change in future builds, Strategy may not be able to provide additional code on this matter even though this customization is provided at this time for this specific build
 


Comment

0 comments

Details

Knowledge Article

Published:

June 23, 2017

Last Updated:

June 23, 2017