Attempted to read or write protected memory while Appending to File Geodatabase

3886
2
04-07-2011 08:10 AM
MeleKoneya
Regular Contributor
I am using ArcObjects to delete features and append features to a File Geodatabase.   The last time this process ran,  I got the following error message:

"Attempted to read or write protected memory.  This is often an indication that other memory is corrupt"

The Feature Class was corrupt after the processs.

I reran the process in ArcCatalog using ArcToolBox and on the the second attempt,   I was able to successfully delete and append features.

Any ideas on what causes this error and more importantly,  how to prevent it in the future?

Thanks,

Mele
0 Kudos
2 Replies
ChrisBradberry
Occasional Contributor
Hi,

If you have a feature cursor, or selection set you might have the feature class hung up.  Try the  Marshal.ReleaseComObject(pCursor); to free up your feature class.  This sometimes works for me.

Chris
0 Kudos
ChrisBradberry
Occasional Contributor
Hey,

After reading some more forums, I think you should use the ComReleaser rather than the marshall.ReleaseCom();

See this forum http://forums.arcgis.com/threads/4298-What-s-Up-with-ComReleaser-Is-it-really-working

Chris
0 Kudos