none
N-tier sync framework with filtering

Răspunsuri

Toate mesajele

  • have you decided on which database provider to use?

    here's two samples using SqlSyncProvider/SqlCeSyncProviders over WCF

    http://code.msdn.microsoft.com/Database-SyncSQL-Server-e97d1208

    http://code.msdn.microsoft.com/Database-Sync-SQL-Server-7e88adab

     

    if you want the Local Databas Cache generated code, have a look at this:

    http://msdn.microsoft.com/en-us/library/dd938879.aspx

     

    24 noiembrie 2011 02:07
    Moderator
  • Hi,

     

    thanks for the help! I managed to do following things:

    • separate client and server side
    • connect the client to the WCF service of the server
    • syncronize data

    What I need now is the filtering. So far i've done following things: (basicly: http://msdn.microsoft.com/en-us/library/ff928701%28v=SQL.110%29.aspx just with sql compact for the client)

    • write a separate program to provision the client (sql compact database) and the server
    • in the sepatate program I created a filtered scope
    • in my main program in the client i managed to execute:

     

    syncOrchestrator = new SampleSyncOrchestrator(
    new SqlSyncProvider("RetailCustomers", clientSqlConn, null, "Sync"),
    new SqlSyncProvider("RetailCustomers", serverConn, null, "Sync")
    );
    syncStats = syncOrchestrator.Synchronize();
    

     

    syncStats says, that I have downloaded one table.

    Whats missing:

    • update my Entity Model based on my sql compast sdf database

    How can I do that? I've tried EntityContext.Refresh(StoreWins, entity table), but nothing happended.

     

    Can you help me with this?

     

    Thanks a lot!

    John



    • Editat de goja15 24 noiembrie 2011 15:18
    24 noiembrie 2011 15:16
  • are you just trying to save something to your table? or are you trying to use EF to do the conflict handling?
    24 noiembrie 2011 23:46
    Moderator
  • Hi,

     

    I have the following tasks with the program:

    • create a local database that conatins only a fragment of the server database, so i must use multiple dynamic parameter filters
    • use the local database, import data, and syncronize it back to the server

    Problems that I could not solve so far:

    • I started SyncFramework with the "add new item - local database cash" in VS and created an ADO.NET Entity framework model on it. This works fine, but it provides no filtering. I created code for filtering the database, but then I could not use the Entity model with it. Is it even possible? because if i use filter, only a subset of th tables and data will be available on the client, that means the Entity model would have to be generated dynamicly.
    • I did not manage to deprovision the server - it always says, that is it not ywt provisioned. I use this code for provisioning:

     SqlSyncScopeProvisioning serverTemplate = new SqlSyncScopeProvisioning(serverConn, scopeDesc, SqlSyncScopeProvisioningType.Template);
     serverTemplate.ObjectSchema = shemaName;

    • create multiple filters - I only managed to create one filter so far, If i try to create a second one, exception come all over

    What do i do wrong?

     

    John

     

    25 noiembrie 2011 08:56
  • the Local Database Cache uses a different set of providers: SqlCeClientSyncProvider/DbServerSyncProvider and is provisioned differently.

    the ScopeProvisioning APIs works with SqlSyncProvider/SqlCeSyncProvider.

     likewise, Sync Framework does not support dynamic filtering.

    you might want to go thru the tutorials in the documentation that comes with the framework or check them online:

    http://msdn.microsoft.com/en-us/library/ff928494(v=SQL.110).aspx

    25 noiembrie 2011 17:22
    Moderator
  • Does that mean, that Local Database Cache does not support filternig?

    I'd need the easyness of Local Database Cash, with it's WCF suppor combined with filtering.

    Is this somehow possible?

    If Filtering only works with ScopeProvisioning than how can I achieve that combined with WCF services?

    So basicly i'd need an N-Tier applicartion with WCF support with local database cache AND filtering.

     

    Thanks



    • Editat de goja15 25 noiembrie 2011 23:13
    25 noiembrie 2011 23:11
  • the Local Database Cache Wizard itself doesnt support filtering. but you can modify the code after its generated to add the filters.

    see: http://jtabadero.wordpress.com/2010/03/17/adding-filter-to-local-database-cache-generated-sync/

    if you're using WCF, you will have to add the filter in the WCF service code.

    26 noiembrie 2011 01:07
    Moderator
  • Hi,

     

    thanks for the help! I've tried your last link, it is also good, but i've found an even simpler and with that it works:

    http://social.microsoft.com/Forums/eu/syncgeneral/thread/cd7f6bc1-b019-4571-92d9-c4efcb91f786

     

    Thanks for your help so far again!

    • Marcat ca răspuns de goja15 27 noiembrie 2011 11:22
    27 noiembrie 2011 11:22
  • Here is another complete solution for N tier Sync over WCF,including central portal code for sync configuration..

    http://www.rajneeshnoonia.com/blog/2012/03/n-tier-sync-framework/

    Regards

    Rajnish Noonia

    30 martie 2012 22:16