Offline changes synchronization

718
1
02-07-2018 04:35 AM
PiotrekGaszewski
New Contributor II

Hi.

In my WPF application I’m trying to use off-line map functionality. Right now my feature service is configured for data sync and I’m able to create data replica on server and download local copy of geodatabase.

gdbSyncTask = await GeodatabaseSyncTask.CreateAsync(_featureServiceUri);

 

Envelope extent = new Envelope(xmin, ymin, xmax, ymax, new SpatialReference(wkidStart));

GenerateGeodatabaseParameters generateParams = await _gdbSyncTask.CreateDefaultGenerateGeodatabaseParametersAsync(extent);

_generateGdbJob = _gdbSyncTask.GenerateGeodatabase(generateParams, _gdbPath);

_generateGdbJob.JobChanged += GenerateGdbJobChanged;

_generateGdbJob.ProgressChanged += ((object sender, EventArgs e) =>

{

UpdateProgressBar();

});

_generateGdbJob.Start();

After initial synchronization, I’m able to successfully work with map in off-line mode. This includes operations like adding new geometries or editing existing polygons inside local DB.

However, when I’m trying to synchronize changes back to server – I’m getting no results.

To perform data synchronization with local database – I’m using the following code:

SyncGeodatabaseParameters parameters = new SyncGeodatabaseParameters()

{

GeodatabaseSyncDirection = SyncDirection.Bidirectional,

RollbackOnFailure = false              

};

 

Geodatabase gdb = await Geodatabase.OpenAsync(this.GetGdbPath());

foreach (GeodatabaseFeatureTable table in gdb.GeodatabaseFeatureTables)

{

long id = table.ServiceLayerId;

SyncLayerOption option = new SyncLayerOption(id);

option.SyncDirection = SyncDirection.Bidirectional;

parameters.LayerOptions.Add(option);

}

 

_gdbSyncTask = await GeodatabaseSyncTask.CreateAsync(_featureServiceUri);

SyncGeodatabaseJob job = _gdbSyncTask.SyncGeodatabase(parameters, gdb);

job.JobChanged += SyncJob_JobChanged;

job.ProgressChanged += SyncJob_ProgressChanged;

job.Start();

Everything goes well. The synchronization ends with status “Succeeded”. The messages logged by the SyncGeodatabaseJob are like on the screen below:

However – when I open edited feature layer from server inside map web client I cannot found any of my local changes.  In the serve database I can also see that no new records were created during synchronization.

Interesting think is that when I open “Replica” data inside web I can see the following information:

Replica Server Gen: 

Creation Date: 2018/02/07 10:49:54 UTC 

Last Sync Date: 2018/02/07 10:49:54 UTC 

 

The “Last Sync Data” is equal to replica “Creation date” However, in the replica log in ArcMap I can see the following information:

 

Can anyone can tell me how should I interpret above described situation? Am I missing some steps in my code? Or maybe some configuration feature is missing on the server? It looks like data modifications are successfully pushed back to replica on server but after that replica is not synchronized with server database (should it work automatically?).

I’m# a “fresh” person regarding ArcGis development so any help will be appreciated  

0 Kudos
1 Reply
RafalKordalski
New Contributor

Hello,

Looks like facing same problem, however with android sdk (latest) + basic licence. Was the problem solved?

0 Kudos