The object invoked has disconnected from its clients. (RPC_E_DISCONNECTED)

3628
3
10-05-2011 10:47 AM
GaneshSurange
New Contributor II
I have a c# script developed to update feature class. This script always runs fine on one server and not always - but most of the times throws below error on other server. The error comes at a function call of IFeatureClass 'Insert' method.

Error: The object invoked has disconnected from its clients. (Exception from HRESULT: 0x80010108 (RPC_E_DISCONNECTED))

I only see one difference in servers, that one has IIS and other does not.
But, IIS is not required for this script; because the script is a console application.
Scripts runs OK on a server with IIS and fails sometimes on server without IIS.

Please share a fix or suggest/provide a solution.
0 Kudos
3 Replies
GaneshSurange
New Contributor II
I have a c# script developed to update feature class. This script sometimes runs fine and sometimes throws below exceptionon. The error comes at a function call of IFeatureClass 'Insert' method.
Error: The object invoked has disconnected from its clients. (Exception from HRESULT: 0x80010108 (RPC_E_DISCONNECTED))


How to get rid of this exception? Please share a fix/root cause or suggest/provide a resolution.
0 Kudos
AlexanderGray
Occasional Contributor III
is this ArcGIS desktop or engine code or are you doing something with ArcGIS webserver?  If this is all desktop or engine code than IIS shouldn't have anything to do with it.  I often get object has disconnected from its client errors.  Usually the problem is that the object was explicitly released using the marshal com releaser or the esri com releaser.  Occasionally, I get problems threading, such as having an arcobjects event listener on a non-modal form.  In almost all cases it boils down to a programming mistake that I made.  My bet is the error happens for a particular code execution path that doesn't happen often.
0 Kudos
GaneshSurange
New Contributor II
This is a console application using C# and ArcObject to update a feature class. I updated start of this forum and  IIS should not do anything with issue. I was able to catch this exception on below line of code.

//start an insert cursor running on the featuretable
m_fcsTarget= m_fclTarget.Insert(true);

But, not able to understand; why behaviour is not consistent?
Below function have this line of code.


public
EditUtility(IFeatureClass TargetFeatureClass, Boolean DeleteExistingRecords)
        {
//set the target feature class property
            m_fclTarget = TargetFeatureClass;

//start an edit session
IDataset dstTarget;
            dstTarget = (
FeatureClass)m_fclTarget;

IWorkspace workspace = dstTarget.Workspace;

//Cast for an IWorkspaceEdit
m_wseTarget = (
IWorkspaceEdit)workspace;
m_wseTarget.StartEditing(
true);
            m_wseTarget.StartEditOperation();

//delete existing records if requested
if (DeleteExistingRecords == true)
            {
//use a table interface to delete all rows
ITable tblTarget;

                tblTarget = (
ITable)dstTarget;

                tblTarget.DeleteSearchedRows(
null);
}

//start an insert cursor running on the feature table
            m_fcsTarget = m_fclTarget.Insert(
true);
        }
0 Kudos