CoreHost - ApplyEdits fails on version (memory allocation failure)

157
1
4 weeks ago
RyanMuller_Cognizant
New Contributor

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. 

 

ArcGIS.Core.Data.ServiceException: 'memory allocation error'

Inner Exception
COMException: Exception from HRESULT: 0x80040218

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.

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.

 

Task result = QueuedWorker.Run(() =>
{
    using (Geodatabase updateGdbDefault = GeodatabaseService.GetGeodatabaseFromUri(config.UpdateGeodatabaseFilePath))
    using (Geodatabase joinGdb = GeodatabaseService.GetGeodatabaseFromUri(config.JoinGeodatabaseFilePath))
    {
        //This one works fine
        updateGdbDefault.ApplyEdits(() => {
             
        });
        VersionManager vm = updateGdbDefault.GetVersionManager();
        if (!vm.GetVersionNames().Any(version => 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(() =>
            {

            });
        }
    }
});

 

 

Tags (3)
0 Kudos
1 Reply
Aashis
by Esri Contributor
Esri Contributor

No, it should work with non-default branches in the CoreHost. Are you using a branched versioned feature service?

0 Kudos