SQLCE 3.5 Sync BUG RRS feed

  • Question

  • I'm using SQL'05 SQLCE 3.5, VS'08 building VB.NET applications.


    I'm using the LocalCache to sync local SQLCE data and the SQL05


    When a record is being created on SQLCE both the LastEditDate and CreateDate get set on the SQL'05.


    When the record gets updated in the SQLCE the CreateDate gets reset to NULL on the SQL'05.


    When I try to pull the table contents to another app using local sync the records with the NULL CreateDate do not get propagated.




    David L.

    • Moved by Max Wang_1983 Friday, April 22, 2011 7:28 PM forum consolidation (From:SyncFx - Microsoft Sync Framework Database Providers [ReadOnly])
    Monday, March 3, 2008 3:50 PM

All replies


    Hi David,


    the LocalCache project only create a donwloadonly scenario by defualt. did you modified the code to support upload ?


    by saying "When the record gets updated in the SQLCE the CreateDate gets reset to NULL on the SQL'05", do you mean: the update will set the CreateDate to NULL while it was non-null before the update ?


    is it possible you trace the update in sql profiler to see what queries were executed on the server during the update ?




    Friday, March 7, 2008 2:47 PM
  • Hi Yunwen


    1. I'm using the following:


    Dim l As New LocalDataCacheSyncAgent

    l.Stations.SyncDirection = Microsoft.Synchronization.Data.SyncDirection.Bidirectional

    l.ChatLog.SyncDirection = Microsoft.Synchronization.Data.SyncDirection.Bidirectional

    l.Orders.SyncDirection = Microsoft.Synchronization.Data.SyncDirection.Bidirectional

    l.WorkOrders.SyncDirection = Microsoft.Synchronization.Data.SyncDirection.Bidirectional


    l = Nothing


    2. yes, the values is set to a datetime on record insert, and then is set to null on update.


    3. I started an SRX with Microsoft, hopefully I'll get an answer soon as to the cause.


    David L.

    Friday, March 7, 2008 3:01 PM
  • Question on  - "2. yes, the values is set to a datetime on record insert, and then is set to null on update."


    Which object set the "CreateTime" to NULL, the update trigger? 
    Was this trigger object created by Visual Studio or it was modified later on?

    Can I assume the Sync Adapter Commands were not modified after then got created?




    This posting is provided AS IS with no warranties, and confers no rights.

    Tuesday, March 11, 2008 6:09 PM
  • That's the $64,000 question. I started an SRX, and MS was able to reproduce the problem, they do not have an answer yet to which program element is causing the issue yet.


    All the working parts in SQL'05 and the VB 9 program are set up by the local data cache sync tool that's included in VS'08. I have not modified any of the code, table changes or triggeres that get created for the sync process.


    I'm waiting to hear from MS, will update this thread when I can.


    David L.

    Wednesday, March 12, 2008 1:38 PM
  • OK, I got the first reposnse on the SRX that's mapping the issue:


    Client side a row is inserted.

    Since, client has no triggers to these columns, we will have NULLs in those at client side.

    Client sends the row to server.

    Somehow, server sends another insert back to client, with same data, but these other two columns populated.

    Client side, the server's row becomes conflict.

    Client insert, server insert is raised, and it is ignored at client (default resolution is to continue on ClientInsertServerInsert, so, it is ignored)

    Client side columns remain with NULLs.

    Client does an update, and this update goes to the server.

    Server applies the update, and changes the Createdate to be NULL (as per client's value)

    The trigger at server side (update trigger) just changes the LastEditDate value.

    Server sends nothing back, so, client remains as is.


    This just defines the problem, and does not resolve it as of yet. Seems that the culprit is the LocalSyncCache code generator, but MS seems to be shy of stating this outright.


    More when I get some better feedback on the SRX


    David L.

    Friday, March 21, 2008 2:33 PM

    Thanks David.


    there are serveral things that need to be done in order to make the code to support the bidir sync:


    1. the table should be altered to add the createOriginateId and lastEditOrigintorId so it tracked who make the change,along with when the changes were made.

    2. the select queries should add a statements to the where clause to "Not send back to the client the rows the client just changed", i.e. something like and createOriginateid ( or lastEditOrignatorId ) <> myOriginatorId )

    3. update the upload command to set the orginatorID correctly in the table.

    4. add logic to handle conflicts

    5. test it to ensure everything is fine and meet you requirements.


    also, just for your case, please make sure your table has default value for the CreateDate = getdate(). and also, change the selectQuery so the tracking columns ( createDate, LastEditDate, createOriginatorId, lastEditOriginatorId ) are not in the select clause so they are not downloaded to the client at all.


    Hope this can help.




    Saturday, March 29, 2008 2:07 AM
  • Hi Yunwen


    Thanks for the advise, however, the actual code that does the tricks is generated by the Local Synce Cache wizard in VS2008, and get re-written each time that I make changes to the cache, so, making changes there is a way to get nailed.


    MS is looking for a solution, internally, and I hope that since they have all the players, they'll be able to give me a patch that will work, or a work around.


    This is a mess, sitting in the middle of a live project, and the SRX is tretching, is was started on 3/4 and I have no resolution from MS as of yet. I should know better than to use a new feature from MS, but it seemed, at the time, to be a time saver.


    David L.

    Monday, March 31, 2008 1:43 PM
  • Anymore info on this.  I get bidirectional to work once, then it only works one way (server to client or vice versa).  Very sporadic.


    Now it does not work at all....


    Anyone know how to "start fresh" besides deleting the .snyc file?




    Saturday, May 10, 2008 1:20 AM
  • Check out the thread MSDN Forums » Visual Studio 2008 (Pre-release) » Microsoft Synchronization Services for ADO.NET » Sync Framework Buggy as hell


    I can't post to it anymore, system keeps logging me out each time I try to post there.


    David L.

    Monday, June 2, 2008 1:46 PM

    this is happening to me also. there is an issue on the MSDN server and the MSDN server team is working on it.  would suggest to copy your content and try to post it mutiple times to see if one is on.




    Monday, June 2, 2008 11:32 PM