AnsweredAssumed Answered

Throwing AccessViolationException when querying data of featureClass

Question asked by HimBromBeere on Aug 29, 2014
Latest reply on Sep 1, 2014 by HimBromBeere

Hey there,


when I query a featureClass with featureClass.Search(filter, true) I get the exception mentioned above. Unfortunately I cannot reproduce this error in any way, it happens only on production-machine of a customer. But hence the data being queried is quite huge (some millions of points) searching for the one feature that fails nearly impossible or at least quite annoying. My customer also guaranteed that there are no writing processes on the featureClass (SDE-version), so I wonder where this exception may come from. To save memory I release every row after having handled it (calling Marshal.ReleaseComObject within a loop as long as references exist):


List<string> UUIDs = new List<string>();
IQueryFilter filter = new QueryFilter { SubFields = "UUID"};  // this should save us so much time
cursor = ((ITable)dataset).Search(filter, true); // we take a recycling-cursor because we handle only immutable strings (UUIDs) 

while ((row = cursor.NextRow()) != null)
     ReleaseComObject(row);                      // release the underlying COM-object as often as references exist


After many thousands of features handled we get the exception. Unfortunately I could not even print any ID of the faulty feature to handle it manually because I cannot access it. I do not have any clue how I may get around the issue or at least how to avoid it.


Kind regards