IFeature.Store() intermittently throws HRESULT E_FAIL COM exception

Discussion created by tomfumb on Apr 5, 2011
Latest reply on May 31, 2011 by tomfumb
I have an ArcMap add-in which is updating fields for a collection of line features within a loop. After updating values for these fields I call the Store() function of the IFeature-implementing feature (each store is correctly contained within IWorkspaceEdit.StartEditOperation and StopEditOperation, and the loop within StartEditing and StopEditing).

The same features (so far I know of 2, in a sample of more than 10,000) will regularly cause the Store() function to return "Error HRESULT E_FAIL has been returned from a call to a COM component." with no indication why. I can't see anything obviously different between successful features and failing features (i.e. unusual geometry values, special characters in attributes) so I'm stumped as to what's causing this. If I swallow the error and carry on the add-in continues to function as expected until the next failing feature is encountered.

The features can have a relationship to an annotation feature class, but by the first fail roughly half of the processed features do have a relationship and the others don't, so I can't say it's related to this association.

I currently get the source data from a personal geodatabase (.mdb) but the same problem occurs in the SDE system the features were exported from. When I received it the mdb required upgrading to the v10 format, but I got the same behaviour before and after this upgrade.

Can anyone suggest any reasons why this error might be occurring on only *some* of my features, and if there is any way to find out more about the error? I find COM exceptions the single most frustrating aspect of my day job.