<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Throwing AccessViolationException when querying data of featureClass in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/throwing-accessviolationexception-when-querying/m-p/603244#M16160</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I will try this out, but can take some days to test it within production-environment. I´ll let you know as far as I have further information...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EDIT:&lt;/P&gt;&lt;P&gt;After having changed it to non-recycling cursor the error still occurs within my&amp;nbsp; customers environment, although now enclosed within a OutOfMemory-Exception from log4net:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_14098102934303127 jive_text_macro" jivemacro_uid="_14098102934303127"&gt;
&lt;P&gt;&amp;lt;log4net.Error&amp;gt;Exception rendering object type [System.AccessViolationException]&amp;lt;stackTrace&amp;gt;System.OutOfMemoryException: Eine Ausnahme vom Typ "System.OutOfMemoryException" wurde ausgelöst.&lt;/P&gt;
&lt;P&gt;bei log4net.ObjectRenderer.RendererMap.Get(Type type)&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Calibri','sans-serif';"&gt; bei log4net.ObjectRenderer.RendererMap.FindAndRender(Object obj, TextWriter writer)&amp;lt;/stackTrace&amp;gt;&amp;lt;/log4net.Error&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;

&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However I suppose this is the same error as mentioned previously, handling the AVE (hopefully) eliminates this strange surrounding one as well (although its a great miracle that machine runs out of memory when logging an exception). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BTW: I copied the data from customer to development-machine. But the error does not occur here, so its obviously no data-error&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 01 Sep 2014 09:59:13 GMT</pubDate>
    <dc:creator>CarstenSchumann</dc:creator>
    <dc:date>2014-09-01T09:59:13Z</dc:date>
    <item>
      <title>Throwing AccessViolationException when querying data of featureClass</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/throwing-accessviolationexception-when-querying/m-p/603242#M16158</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey there,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;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):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="c#" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_14093082279163919" jivemacro_uid="_14093082279163919" modifiedtitle="true"&gt;
&lt;P&gt;List&amp;lt;string&amp;gt; UUIDs = new List&amp;lt;string&amp;gt;();&lt;/P&gt;
&lt;P&gt;IQueryFilter filter = &lt;SPAN style="color: blue;"&gt;new&lt;/SPAN&gt; &lt;SPAN style="color: #2b91af;"&gt;QueryFilter&lt;/SPAN&gt; { SubFields = "UUID"};&amp;nbsp; // this should save us so much time&lt;/P&gt;
&lt;P&gt;cursor = ((&lt;SPAN style="color: #2b91af;"&gt;ITable&lt;/SPAN&gt;)dataset).Search(filter, &lt;SPAN style="color: blue;"&gt;true&lt;/SPAN&gt;); &lt;SPAN style="color: green;"&gt;// we take a recycling-cursor because we handle only immutable stri&lt;/SPAN&gt;&lt;SPAN style="color: green;"&gt;ngs (UUIDs)&lt;/SPAN&gt; &lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="color: blue;"&gt;while&lt;/SPAN&gt; ((row = cursor.NextRow()) != &lt;SPAN style="color: blue;"&gt;null&lt;/SPAN&gt;)&lt;/P&gt;
&lt;P&gt;{&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; UUIDs.Add((&lt;SPAN style="color: blue;"&gt;string&lt;/SPAN&gt;)row.get_Value(1));&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="color: #2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ReleaseComObject(row);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // release the underlying COM-object as often as references exist&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;}&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Aug 2014 10:33:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/throwing-accessviolationexception-when-querying/m-p/603242#M16158</guid>
      <dc:creator>CarstenSchumann</dc:creator>
      <dc:date>2014-08-29T10:33:55Z</dc:date>
    </item>
    <item>
      <title>Re: Throwing AccessViolationException when querying data of featureClass</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/throwing-accessviolationexception-when-querying/m-p/603243#M16159</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Have you tried the call to &lt;STRONG&gt;Search &lt;/STRONG&gt;with &lt;STRONG&gt;recycling = false&lt;/STRONG&gt;?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The name of that parameter and its related documentation make it sound very appealing, but I have ran into more problems than not when using &lt;STRONG&gt;recycling = true&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As you mentioned, you're already releasing the row object after each iteration, so your memory footprint should remain fairly stable as the while-loop executes.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Aug 2014 16:55:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/throwing-accessviolationexception-when-querying/m-p/603243#M16159</guid>
      <dc:creator>ErinBrimhall</dc:creator>
      <dc:date>2014-08-29T16:55:45Z</dc:date>
    </item>
    <item>
      <title>Re: Throwing AccessViolationException when querying data of featureClass</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/throwing-accessviolationexception-when-querying/m-p/603244#M16160</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I will try this out, but can take some days to test it within production-environment. I´ll let you know as far as I have further information...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EDIT:&lt;/P&gt;&lt;P&gt;After having changed it to non-recycling cursor the error still occurs within my&amp;nbsp; customers environment, although now enclosed within a OutOfMemory-Exception from log4net:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_14098102934303127 jive_text_macro" jivemacro_uid="_14098102934303127"&gt;
&lt;P&gt;&amp;lt;log4net.Error&amp;gt;Exception rendering object type [System.AccessViolationException]&amp;lt;stackTrace&amp;gt;System.OutOfMemoryException: Eine Ausnahme vom Typ "System.OutOfMemoryException" wurde ausgelöst.&lt;/P&gt;
&lt;P&gt;bei log4net.ObjectRenderer.RendererMap.Get(Type type)&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Calibri','sans-serif';"&gt; bei log4net.ObjectRenderer.RendererMap.FindAndRender(Object obj, TextWriter writer)&amp;lt;/stackTrace&amp;gt;&amp;lt;/log4net.Error&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;

&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However I suppose this is the same error as mentioned previously, handling the AVE (hopefully) eliminates this strange surrounding one as well (although its a great miracle that machine runs out of memory when logging an exception). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BTW: I copied the data from customer to development-machine. But the error does not occur here, so its obviously no data-error&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Sep 2014 09:59:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/throwing-accessviolationexception-when-querying/m-p/603244#M16160</guid>
      <dc:creator>CarstenSchumann</dc:creator>
      <dc:date>2014-09-01T09:59:13Z</dc:date>
    </item>
  </channel>
</rss>

