<?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 CoreHost - ApplyEdits fails on version (memory allocation failure) in ArcGIS Pro SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/corehost-applyedits-fails-on-version-memory/m-p/1414287#M11409</link>
    <description>&lt;P&gt;I'm trying to make edits to a version in a CoreHost application. I can use ApplyEdits on the default version but when I try to use it on a version I get a memory allocation failure.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;ArcGIS.Core.Data.ServiceException: 'memory allocation error'&lt;/P&gt;&lt;P&gt;Inner Exception&lt;BR /&gt;COMException: Exception from HRESULT: 0x80040218&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Below is a my code with all the logic stripped out. It fails even if I don't actually have any edits to apply and doesn't even make it inside the ApplyEdits block.&lt;/P&gt;&lt;P&gt;Is CoreHost not meant to work on versions besides Default? Or is there something that I should be doing differently? I've tried putting everything that implements Disposable in a using block but left it out of the example code for brevity.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;Task result = QueuedWorker.Run(() =&amp;gt;
{
    using (Geodatabase updateGdbDefault = GeodatabaseService.GetGeodatabaseFromUri(config.UpdateGeodatabaseFilePath))
    using (Geodatabase joinGdb = GeodatabaseService.GetGeodatabaseFromUri(config.JoinGeodatabaseFilePath))
    {
        //This one works fine
        updateGdbDefault.ApplyEdits(() =&amp;gt; {
             
        });
        VersionManager vm = updateGdbDefault.GetVersionManager();
        if (!vm.GetVersionNames().Any(version =&amp;gt; version.Contains($"joinandupdate{config.UpdateField}")))
        {
            VersionDescription vd = new         VersionDescription($"joinandupdate{config.UpdateField}", "", VersionAccessType.Public);
            vm.CreateVersion(vd);
        }
        ArcGIS.Core.Data.Version v = vm.GetVersion($"joinandupdate{config.UpdateField}");
        using (Geodatabase updateGdb = v.Connect())
        {
            //fails here, doesn't even get inside the block
            updateGdb.ApplyEdits(() =&amp;gt;
            {

            });
        }
    }
});&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 23 Apr 2024 17:43:18 GMT</pubDate>
    <dc:creator>RyanMuller_Cognizant</dc:creator>
    <dc:date>2024-04-23T17:43:18Z</dc:date>
    <item>
      <title>CoreHost - ApplyEdits fails on version (memory allocation failure)</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/corehost-applyedits-fails-on-version-memory/m-p/1414287#M11409</link>
      <description>&lt;P&gt;I'm trying to make edits to a version in a CoreHost application. I can use ApplyEdits on the default version but when I try to use it on a version I get a memory allocation failure.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;ArcGIS.Core.Data.ServiceException: 'memory allocation error'&lt;/P&gt;&lt;P&gt;Inner Exception&lt;BR /&gt;COMException: Exception from HRESULT: 0x80040218&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Below is a my code with all the logic stripped out. It fails even if I don't actually have any edits to apply and doesn't even make it inside the ApplyEdits block.&lt;/P&gt;&lt;P&gt;Is CoreHost not meant to work on versions besides Default? Or is there something that I should be doing differently? I've tried putting everything that implements Disposable in a using block but left it out of the example code for brevity.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;Task result = QueuedWorker.Run(() =&amp;gt;
{
    using (Geodatabase updateGdbDefault = GeodatabaseService.GetGeodatabaseFromUri(config.UpdateGeodatabaseFilePath))
    using (Geodatabase joinGdb = GeodatabaseService.GetGeodatabaseFromUri(config.JoinGeodatabaseFilePath))
    {
        //This one works fine
        updateGdbDefault.ApplyEdits(() =&amp;gt; {
             
        });
        VersionManager vm = updateGdbDefault.GetVersionManager();
        if (!vm.GetVersionNames().Any(version =&amp;gt; version.Contains($"joinandupdate{config.UpdateField}")))
        {
            VersionDescription vd = new         VersionDescription($"joinandupdate{config.UpdateField}", "", VersionAccessType.Public);
            vm.CreateVersion(vd);
        }
        ArcGIS.Core.Data.Version v = vm.GetVersion($"joinandupdate{config.UpdateField}");
        using (Geodatabase updateGdb = v.Connect())
        {
            //fails here, doesn't even get inside the block
            updateGdb.ApplyEdits(() =&amp;gt;
            {

            });
        }
    }
});&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 23 Apr 2024 17:43:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/corehost-applyedits-fails-on-version-memory/m-p/1414287#M11409</guid>
      <dc:creator>RyanMuller_Cognizant</dc:creator>
      <dc:date>2024-04-23T17:43:18Z</dc:date>
    </item>
    <item>
      <title>Re: CoreHost - ApplyEdits fails on version (memory allocation failure)</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/corehost-applyedits-fails-on-version-memory/m-p/1414417#M11412</link>
      <description>&lt;P&gt;No, it should work with non-default branches in the CoreHost. Are you using a branched versioned feature service?&lt;/P&gt;</description>
      <pubDate>Tue, 23 Apr 2024 21:05:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/corehost-applyedits-fails-on-version-memory/m-p/1414417#M11412</guid>
      <dc:creator>Aashis</dc:creator>
      <dc:date>2024-04-23T21:05:21Z</dc:date>
    </item>
  </channel>
</rss>

