Synching disconnected session

Nov 19, 2012 at 10:49 PM

Hi,

I have been testing the sync DataObject.Net extentions which work fine for 2 domains setup with SessionOptions.ServerProfile.

However I want to synchronize a disconnected session with a remote server (through SQL server SSL).

Using a local domain set up with ClientProfile (so SessionOptions.Disconnected is set) and a remote domain setup with ServerProfile didn't work.

Looking down into the source code I saw that when I use ClientProfile, SyncInfo<TEntity>.Target is not persisted in the method SyncManager.OnPersisting (.Target is null), whereas it will be persisted for ServerProfile. I didn't pushed further as it seems I found a workaround setting useSyncLog to true in the SyncManager constructor.

The workaround seems to work fine, synchronization is done both ways (up/down) but I wonder if they are any drawbacks using SyncLog (performance won't be an issue in my case) instead of SyncInfo<T>.

Also, I didn't understand why SyncInfo<TEntity>.Target was not persisted in Disconnected mode. Could you explain why ?

Thanks,

fusdev

 

Nov 20, 2012 at 10:17 PM

Hello fusdev,

thanks for interest in our sync extension.

Currently sync extension is not production ready. This means it's not tested thoroughly and storage format might change in future.

Regarding your questions:

ClientProfile support was not tested yet and according to your experiments it does not work currently. I think this should be easy to fix.

Usage of SyncLog will require 2x insert/update statements when updating sync metadata and you'll have to apply log before doing synchronization.

Generally sync log is used to avoid dead-locks when multiple sessions are accessing the same database. Any changed and persisted entity will produce new record in sync log. Dedicated worker session converts such records to actual changes of SyncInfo<T> objects and then deletes corresponding sync log entries.

Currently sync log is automatically used for all databases except SQLite. SQLite supports only one writer session so there is little reason in having sync log for it.
Probably we should have some configuration options for enabling/disabling sync log.

> Also, I didn't understand why SyncInfo<TEntity>.Target was not persisted in Disconnected mode. Could you explain why ?

This might be a bug. As I've said sync extesion is not tested yet with client profile so there might be issues.

--

Denis