Unable to run RegisterGeodatabaseAsync 10.3.1

2361
1
Jump to solution
11-17-2015 11:15 AM
JoeHershman
MVP Regular Contributor

I thought I would start a new thread because RegisterGeodatabaseAsync and versioned data posted by John Selkirk has not seen any action for a while.  I am having what would seem to be the same issue.

I am using both Desktop and Server version 10.3.1 with Sql Server.  I have created a Feature Service with only one layer and I am sure this layer is versioned and does not have the "Move edits to base" option selected.

I have followed the directions here: Create an offline map—ArcGIS Runtime SDK for .NET | ArcGIS for Developers and have gone through this process multiple times.

I am able to successfully publish the feature service with all capabilities enabled.  Once the feature service is published I can run the GenerateGeodatabaseAsync method without problem as describe in the link above.  I use the following parameters to setup the download

            var gdbParams = new GenerateGeodatabaseParameters(featureServiceInfo, extent)
            {
                OutSpatialReference = RuntimeControls.MapView.SpatialReference,
                SyncModel = SyncModel.PerGeodatabase,
                GeodatabasePrefixName = item.GdbName  // = Leaks
            };

When using a versioned gdb, the SyncModel.PerGeodatabase is required.

After the download is completed I have the following in my SDE_versions table.

nameownerversion_idstatusstate_iddescriptionparent_nameparent_ownerparent_version_idcreation_time
DEFAULTsde110Instance default version.NULLNULLNULL2015-10-22 09:41:32.000
Esri_Anonymous_R_1447778446330GIS5000DEFAULTSDE12015-11-17 10:40:46.000
SYNC_SEND_6317_0GIS51167772160Esri_Anonymous_R_1447778446330GIS502015-11-17 10:40:52.000

At this point I move the downloaded Leaks.geodatabase file to a new machine and run RegisterGeodatabaseAsync:

                GeodatabaseSyncTask task = new GeodatabaseSyncTask(new Uri("http://id-svr003:6080/arcgis/rest/services/Runtime/Leaks/FeatureServer"));
  
                Geodatabase gdb = await Geodatabase.OpenAsync(@"C:\Mobile\Operational\Bidirectional\Leaks.geodatabase");


                GeodatabaseStatusInfo info = await task.RegisterGeodatabaseAsync(gdb);

This fails and the server log shows:

Error: An error occurred while adding an entry to the FEATUREDATASET_CLASSES or the FEATURECLASSES table. [Read only data or unversioned data cannot be replicated. Data versioned with the option to move edits to base cannot be replicated. GlobalIDs are required for two way and one way replica data. Creating one way replica using archiving requires archiving the replicated parent data.]. Version not found [GIS.Leaks_6317]. Version not found [GIS.Leaks_6317]. Version not found [GIS.Leaks_6317]. Version not found [GIS.Leaks_6317]. Version not found [GIS.Leaks_6317]. Version not found [GIS.Leaks_6317].

I have gone through this process a number of times and always get this failure on RegisterGeodatabaseAsync.  It almost seems to me that it expects the version SYNC_SEND_6317_0 to be named Leaks_6317

This is a total show-stopper, it is not possible to deploy a Runtime offline application if we cannot register the databases as

0 Kudos
1 Solution

Accepted Solutions
JoeHershman
MVP Regular Contributor

What I have come to learn is that this RegisterGeodatabaseAsync is meant for the old 10.2 approach that used a non-versioned archive enabled database.  In the situation that uses a versioned database this method does not work.

The workflow description for creating a version for each user described here Offline maps and versioned data—Documentation (10.3 and 10.3.1) | ArcGIS for Server would seem to be the best approach for achieving what is described by the workflow that requires registering the offline database on multiple machines.  For a situation with many users my thinking is to have a shared login so you could have multiple users writing to the same version. 

View solution in original post

0 Kudos
1 Reply
JoeHershman
MVP Regular Contributor

What I have come to learn is that this RegisterGeodatabaseAsync is meant for the old 10.2 approach that used a non-versioned archive enabled database.  In the situation that uses a versioned database this method does not work.

The workflow description for creating a version for each user described here Offline maps and versioned data—Documentation (10.3 and 10.3.1) | ArcGIS for Server would seem to be the best approach for achieving what is described by the workflow that requires registering the offline database on multiple machines.  For a situation with many users my thinking is to have a shared login so you could have multiple users writing to the same version. 

0 Kudos