You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/Provision.rst
+58-2
Original file line number
Diff line number
Diff line change
@@ -119,7 +119,7 @@ First of all, if you are just using ``agent.SynchronizeAsync()``, everything wil
119
119
120
120
But you can use the **orchestrators** to do the job. It will allow you to migrate your setup, without having to make a synchronization.
121
121
122
-
You have 2 new methods on both orchestrators:
122
+
You have one new method on both orchestrators:
123
123
124
124
On ``LocalOrchestrator``:
125
125
@@ -192,7 +192,7 @@ For instance, the ``RemoteOrchestrator`` ``MigrationAsync`` could be really usef
192
192
193
193
Once migrated, all new clients, will get the new setup from the server, and will apply locally the migration, automatically.
194
194
195
-
What Setup migration doesn't do !
195
+
What Setup migration does not do !
196
196
-----------------------------------
197
197
198
198
Be careful, the migration stuff will **only** allows you to migrate your setup (adding or removing tables from your sync, renaming stored proc and so on ...)
@@ -214,6 +214,62 @@ But, it won't work if:
214
214
If you have to deal with this kind of situation, the best solution is to handle this migration by yourself using ``ProvisionAsync`` and ``DeprovisionAsync`` methods.
215
215
216
216
217
+
Last timestamp sync
218
+
-----------------------
219
+
220
+
|What happens if you're adding a new table ?
221
+
|What will happen on the next sync ?
222
+
|Well as we said the new table will be provisioned (stored proc, triggers and tracking table) on both databases (server / client) and the table will be created on the client.
223
+
224
+
Then the **DMS** framework will make a sync ....
225
+
226
+
And this sync will get all the rows from the server side **that have changed since the last sucessful sync**
227
+
228
+
And your new table on the client database has ... **NO ROWS** !!!
229
+
230
+
|Because no rows have been marked as **changed** in the server tracking table since the last sync process.
231
+
|Indeed, we've just created this tracking table on the server !!
232
+
233
+
So, if you're adding a new table, you **MUST** do a full sync, calling the ``SynchronizeAsync()`` method with a ``SyncType.Reinitialize`` or ``SyncType.ReinitializeWithUpload`` parameter.
234
+
235
+
|Adding a new table is not trivial.
236
+
|Hopefully if you are using ``snapshots`` it should not be too heavy for your server database :)
237
+
238
+
Forcing Reinitialize sync type from server side.
239
+
-------------------------------------------------
240
+
241
+
|As we saw, it could be useful to force a reinitialize from a client, to get all the needed data.
242
+
|Unfortunatelly, you should have a *special* routine from the client side, to launch the synchronization with a ``SynchronizeAsync(SyntType.Reinitialize)``, like an admin button or whatever.
243
+
244
+
Fortunatelly, using an interceptor, from the **server side**, you are able to *force* the reinitialization from the client.
245
+
246
+
On the server side, from your controller, just modify the request `SyncContext` with the correct value, like this:
247
+
248
+
.. code-block:: csharp
249
+
250
+
[HttpPost]
251
+
publicasyncTaskPost()
252
+
{
253
+
254
+
// Get Orchestrator regarding the incoming scope name (from http context)
0 commit comments