locked
server-client sync not working RRS feed

  • Question

  • I used the sync sample and modified to work with my table.  The insert function works fine on both server and client.  I have syncronized from client-server with no problem.  The server-client approach is not working.  Bi-directional is set.  And no errors are given.  Any thoughts?

    • Moved by Max Wang_1983 Friday, April 22, 2011 6:04 PM forum consolidation (From:SyncFx - Microsoft Sync Framework Database Providers [ReadOnly])
    Monday, August 4, 2008 5:05 PM

Answers

  • I work with Trey and took a look at his problem. When I ran a trace with SQL Profiler, I saw the stored procedure sp_orders_incrinserts with the where clause of "WHERE o.create_timestamp between @sync_last_received_anchor + 1 and @sync_new_received_anchor and o.update_originator_id = 0".

    I ran a select statement with this where clause (with and without "
    o.update_originator_id = 0". With that piece of the where clause, nothing was returned. Without it, the proper information came back. In the table, the update_originator_id allows nulls and there is no default value and the random insert doesn't put anything in that field.

    So, to fix the problem, I just put in a default value of 0 and everything works correctly.
    Monday, August 25, 2008 9:13 PM

All replies

  • Trey,

    Is this working now after your conversation with Yunwen on another thread?

     

    -Sudarshan

    Monday, August 4, 2008 7:02 PM
    Moderator
  • No.  That was an different problem.

     

    Monday, August 4, 2008 7:39 PM
  • Can I ask you which sample you are using? Is it a SQL to SQL CE scenario or a SQL to SQL scenario? Can you explain more what you mean by insert function works fine on client and server but the server to client sync does not work? We might have to look at the modifications you have made to figure this out.

     

    thanks

    Sudarshan

     

    Monday, August 4, 2008 7:48 PM
    Moderator
  • My app is based on the SQL Express - Client Synchronization Sample posted at http://code.msdn.microsoft.com/Release/ProjectReleases.aspx?ProjectName=sync&ReleaseId=1200

     

      I modified it to work with my table in the sample database.  The insert function is based on the insert button on the sample form.  The insert function works with my app from both the client side and the server side.  The sync function only works from my client to server.  If I do an insert on the server using the insert button, the new record does not sync into my client. 

     

    Monday, August 4, 2008 8:26 PM
  •  

    we just identified a bug in the sample. could you modify the code as Mahesh put in this post http://forums.microsoft.com/sync/ShowPost.aspx?PostID=3530045&SiteID=75 to see if this addressed your this issue ?

     

    thanks

    Yunwen

     

    Monday, August 4, 2008 10:19 PM
    Moderator
  • I tried this fix, but it did not work. 

    Is there anything else that I need to do?  Also, is there anyway that someone could look at my modification to the sample?

     

    Thanks

     

    Trey

    Wednesday, August 6, 2008 4:32 PM
  • I work with Trey and took a look at his problem. When I ran a trace with SQL Profiler, I saw the stored procedure sp_orders_incrinserts with the where clause of "WHERE o.create_timestamp between @sync_last_received_anchor + 1 and @sync_new_received_anchor and o.update_originator_id = 0".

    I ran a select statement with this where clause (with and without "
    o.update_originator_id = 0". With that piece of the where clause, nothing was returned. Without it, the proper information came back. In the table, the update_originator_id allows nulls and there is no default value and the random insert doesn't put anything in that field.

    So, to fix the problem, I just put in a default value of 0 and everything works correctly.
    Monday, August 25, 2008 9:13 PM