<?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: FeatureCursor cannot open any more tables in parallel loop in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/featurecursor-cannot-open-any-more-tables-in/m-p/593531#M15984</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Yeah you can't essentially edit a table in two different processes at the same time.&amp;nbsp; It requires an exclusive lock to do that.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Also, I've found that instead of setting the feature cursor to null, something like this is much better:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
using (ComReleaser cr = new ComReleaser())
{
&amp;nbsp;&amp;nbsp; IFeatureCursor updateCursor = featureClass.Update(queryFilter, false);
&amp;nbsp;&amp;nbsp; cr.ManageLifetime(updateCursor);
&amp;nbsp;&amp;nbsp; // Do stuff
}
GC.Collect();
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 12 Dec 2021 01:29:51 GMT</pubDate>
    <dc:creator>JohnStephens</dc:creator>
    <dc:date>2021-12-12T01:29:51Z</dc:date>
    <item>
      <title>FeatureCursor cannot open any more tables in parallel loop</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/featurecursor-cannot-open-any-more-tables-in/m-p/593529#M15982</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi all,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am using VB 2010 to make ArcGIS 10.0 Add-Ins. I always use:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;newFeatCursor = Nothing
GC.Collect()&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;or &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;System.Runtime.InteropServices.Marshal.ReleaseComObject(newFeatCursor)
GC.Collect()&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;everytime I use featureCursor to insert features, or others. That piece of code keeps me away from an error that states: "Cannot open any more tables." &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Now I have hundred thousands of features to insert. When I use normal loop ( for loop) it works perfectly. Then I want to change those calculations followed by the feature insertion paralleled. I use Parallel.For in VB 2010. And the problem comes when the error: "Cannot open any more tables." keeps coming and coming even though I use:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;newFeatCursor = Nothing
GC.Collect()&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;or &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;System.Runtime.InteropServices.Marshal.ReleaseComObject(newFeatCursor)
GC.Collect()&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any help to make the feature insertion in parallel processing successful will be much appreciated.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 28 Sep 2013 08:27:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/featurecursor-cannot-open-any-more-tables-in/m-p/593529#M15982</guid>
      <dc:creator>juan_marvinwirjomartono</dc:creator>
      <dc:date>2013-09-28T08:27:39Z</dc:date>
    </item>
    <item>
      <title>Re: FeatureCursor cannot open any more tables in parallel loop</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/featurecursor-cannot-open-any-more-tables-in/m-p/593530#M15983</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Im not the expert to tell for sure but it seems to me that your problem is because ArcObjects are based on STA - Single threaded Appartment architerture.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Oct 2013 20:13:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/featurecursor-cannot-open-any-more-tables-in/m-p/593530#M15983</guid>
      <dc:creator>DubravkoAntonic</dc:creator>
      <dc:date>2013-10-01T20:13:50Z</dc:date>
    </item>
    <item>
      <title>Re: FeatureCursor cannot open any more tables in parallel loop</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/featurecursor-cannot-open-any-more-tables-in/m-p/593531#M15984</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Yeah you can't essentially edit a table in two different processes at the same time.&amp;nbsp; It requires an exclusive lock to do that.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Also, I've found that instead of setting the feature cursor to null, something like this is much better:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
using (ComReleaser cr = new ComReleaser())
{
&amp;nbsp;&amp;nbsp; IFeatureCursor updateCursor = featureClass.Update(queryFilter, false);
&amp;nbsp;&amp;nbsp; cr.ManageLifetime(updateCursor);
&amp;nbsp;&amp;nbsp; // Do stuff
}
GC.Collect();
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 01:29:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/featurecursor-cannot-open-any-more-tables-in/m-p/593531#M15984</guid>
      <dc:creator>JohnStephens</dc:creator>
      <dc:date>2021-12-12T01:29:51Z</dc:date>
    </item>
  </channel>
</rss>

