ImportGeodatabaseDeltaAsync Obsolete

677
4
02-03-2020 11:37 AM
JoeHershman
MVP Regular Contributor

So in 100.7 the static GeodatabaseSyncTask.ImportGeodatabaseDeltaAsync method is obsolete.  The replacement method is now a class method so requires a GeodatabaseSyncTask object, which in turn requires a Uri of a service to Create.  This makes no sense, having made this a static method was the correct move a few iterations ago.  Why should one need to Create a GeodatabaseSyncTask object?  This method should be available offline, there is no reason to need a connection to the underlying service to merge deltas from an already downloaded delta database into an already offline database.  

What is the driver behind this?  Why would you change something back to the previous less robust approach?  Guess I am rolling back to 100.6

Morten Nielsen

Michael Branscomb

Edit:  Would appear this change occurred at 100.6, so rolling back to 100.5.

Thanks,
-Joe
0 Kudos
4 Replies
dotMorten_esri
Esri Notable Contributor

Joe Hershman It appears this change was done in May 2017, so many versions ago (100.3 I think?), and you should see the same thing in 100.6. Note that you don't need to load the task to perform the import - you don't even need a valid URL. It's a mistake in the API that you just pointed out (thank you for that!).

So there's actually an API bug here. For now I'd recommend you use:

   new GeodatabaseSyncTask("").ImportDeltaAsync(geodatabaseInstance, pathToDelta)

This will under the covers actually call the correct code path, and we'll have a better static method available for Update 8.

0 Kudos
JoeHershman
MVP Regular Contributor

Back in 100.3 in changed to the static method (I could not recall the version this changed).  In 100.6 it has changed back to an instance method.

GeodatabaseSyncTask constructors are internal.  The CreateAsync method requires a Uri, which does not accept an empty string and from quick testing will fail with fake Url or if offline.  

This fails....

var st = await GeodatabaseSyncTask.CreateAsync(new Uri("http://nothing"));

 

Thanks,
-Joe
0 Kudos
dotMorten_esri
Esri Notable Contributor

Oh right! I forgot you have to create it async. Sorry. Just use the deprecated method for now. It'll still work 🙂

Also after double checking you're right this was introduced in 100.7, not 100.3. My bad! I got down the wrong path in the git history.

JoeHershman
MVP Regular Contributor

Thanks

Thanks,
-Joe
0 Kudos