Close SDE connection

Discussion created by deleted-user-VeZur_n9o0OZ on Apr 20, 2010
Latest reply on Sep 28, 2011 by LokionNitrox

I have a function which creates an SDE connection. My connection is immediately visible on the server using the command: sdemon -o -info -I users. However, i am unable to close the connection until ArcMap is closed. I'd like to do so, as i'm using iSchemaLockInfo to detect locks in a seperate function which may run simultaneously

I've dug through the old forums and found a few suggestions - none of which have worked. I have tried so far...
1. Setting my workspace and workspacefactory to nothing
2. Marshal.ReleaseComObject() for the factory and workspace
3. Using iGxRemoteConneciton.disconnect()

So i'm out of ideas. Can anybody close my connection?

Also - my connections never close if i run my code in debug mode. Is that normal? At the moment i'm killing them each time

Finally - my second function edits a coded value domain (empties it, re-populates it). As domains are stored at the workspace level, i figured i should check for connections to the workspace before doing anything. Is this necessary?

Thanks to all,

I am opening a SDE feature workspace as follows...

'Connect to workspace
Dim workspacefactory As IWorkspaceFactory = New SdeWorkspaceFactory
Dim featureworkspace As IFeatureWorkspace = CType(workspacefactory.Open(propertyset, 0), IFeatureWorkspace)