Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

7.2.2 IServer API - How to disconnect from project and server?

Status
Not open for further replies.

entaroadun

Programmer
Sep 27, 2002
583
US
I'm using the 7.2.2 IServer API in a VB project and I can't figure out how to disconnect from the project and server (3-tier).

I connect by instantiating a DSSDataSourceEnumerator for the project sources, then getting a reference to the DSSDataSource for the server. I init the server. I then get a DSSDataSourceEnumerator for the projects and a DSSDataSource for the project I want. I init the project.

I create an IDSSSession from the project.

I run reports and what not. I try to disconnect.

I set all my lower level object references to nothing (everything I created from my IDSSSession). I explicitly close the IDSSSession, and then release it and the project(s) and project source(s) (5 objects in all).

At this point, all my object references are released. However, when I look at the connection monitor on the IServer, my connections to the project and project source are still active.

I've been over my code several times. I'm certain that I am releasing everything.

I've been at this for hours. I can't find a TN on this and the SDK manual only goes over connecting to a project source and project, not disconnecting.

Thanks to anyone who can help.
 
hmmm...check to make sure you close both server connections. There are 2 connections opened when you access a project...one goes to the project itself, the other connects to the server.

But it surprises me that the connection seems to linger...in ASP using the helper objects I say this and the connection disappears for both project and server.
[green]
Set objSession = Server.CreateObject("MSIXMLLib.DSSXMLServerSession.1")

objSession.CloseSession(aConnectionInfo(S_TOKEN_CONNECTION))
[/green]
Since you are using VB try referencing the BaseAPIHelper into your project and see if there are any functions in there that can help you.

Chael
 
Thanks for the reply. After some trial and error I found that IServer API connections stay live until Reset, whereas a single CloseSession call will close both connections for Web.

The proper protocol is:
IDSSSession.Close
IDSSDataSource.Reset (Project)
IDSSDataSourceEnumerator.Reset (Project Enum)
IDSSDataSource.Reset (Project Source)
IDSSDataSourceEnumerator.Reset (Project Source Enum)

Resetting the data sources is enough, but I threw in the Enumerators for good measure. I don't think they do anything, but resetting the Project Source Enum did seem to release memory; perhaps there was a lock on the registry. Better safe than sorry.

Thanks, chael, for your help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top