locked
Manual Insert- Update Sync Problem RRS feed

  • Question

  • Hi

    I'm trying Web Service Off line Application Demo.
    I have noticed that if i manually insert or update record in sql ce then that update doesn't synchronize with the sql server.

    But at the same time if I try random insert or update to update sql ce from application  then it synchronize perfectly fine..

    Reverse in not true ....

    Manual change in sql server reflect change in sql ce....

    Is there any specific reason behind this?
    • Moved by Max Wang_1983 Friday, April 22, 2011 11:08 PM forum consolidation (From:SyncFx - Microsoft Sync Framework Database Providers [ReadOnly])
    Thursday, February 1, 2007 11:13 PM

Answers

  • With SQL Server 2005 (RTM, SP1, SP2), the version of SQL SERVER COMPACT EDITION integrated with it is 3.0/3.1 (Note: DLL versions would still remain as 3.0.xxxx.0).  SQL Server CE 3.5 which is part of ADO.NET Sync Services CTP is not integrated with database management tool SSMS.  We would encourage you to use ORCAS to manipulate the Sync Services databases created on client side.  SQL Server CE 3.5 is fully integrated with ORCAS.  Use Database Explorer (or Server Explorer).  We are also working towards to integrate with Orcas Express editions but nothing is concrete or materialized yet so no promises.

    Thanks,

    Laxmi Narsimha Rao ORUGANTI

    Friday, February 2, 2007 6:54 PM

All replies

  • I'm having the same problem.  Please post if you find a solution.  I will do the same.
    Friday, February 2, 2007 2:48 AM
  •  

    The CTP seems to have integration issues with SSMS. Try the following and you will see what I mean, from the SSMS; connect to client db, from the object explorer right click on the client db object just created and get the properties dialog box, then click on "show connection properties" on the bottom left . Notice that the version posted is 3.0.53.0, while the CE engine version in the CTP is 3.5.0.0.

    I am trying to fine a workaround for this if possible and will update the forum.

    Thanks

    Friday, February 2, 2007 4:12 AM
  • With SQL Server 2005 (RTM, SP1, SP2), the version of SQL SERVER COMPACT EDITION integrated with it is 3.0/3.1 (Note: DLL versions would still remain as 3.0.xxxx.0).  SQL Server CE 3.5 which is part of ADO.NET Sync Services CTP is not integrated with database management tool SSMS.  We would encourage you to use ORCAS to manipulate the Sync Services databases created on client side.  SQL Server CE 3.5 is fully integrated with ORCAS.  Use Database Explorer (or Server Explorer).  We are also working towards to integrate with Orcas Express editions but nothing is concrete or materialized yet so no promises.

    Thanks,

    Laxmi Narsimha Rao ORUGANTI

    Friday, February 2, 2007 6:54 PM
  • Laxmi - perhaps you could expand on why it is important for the correct runtime to be used when making inserts/updates.  I'm assuming this is the reason (please correct me if I'm wrong):

    If you look at the tables in the CE database that have been synced from the server there are two additional columns __sysChangeTxBsn and __sysInsertTxBsn.  There are also additional tables, one of which is __sysOCSDeletedRows.  This has parallels with the desktop version which uses columns to track row inserts and changes, and an additional table that stores tombstone information.

    When you use the SQL CE v3.5 runtime I'm assuming that it will populate these fields when you insert, update or delete rows which means that the sync engine can process them properly.  If you use SQL CE v3.1 runtime these fields will not be updated (and because they are system columns you can't manually update them) so sync will fail.

    Wednesday, February 21, 2007 10:57 AM
  • I'm wondering the same thing.  Does the SQLCE engine take care of the change tracking for you when using Sync Services (much like it does for merge replication)?  Or does the application itself have to handle change tracking?

    One of the reasons I like merge replication is that I'm confident that all changes will be tracked no matter how the database changes occur.

    --Troy

    Monday, March 19, 2007 3:01 PM
  • Nick and Troy,

    You guys are right on. The SqlCe 3.5 runtime knows about sync services and takes care of change tracking for you. This is similar to what we have for SQL merge replication. That said, using CE 3.1 won't work.

    There are a set of methods on the sync agent interface that I encourage you to look at: GetChanges(), ApplyChanges() and AcceptChanges(). If you make changes to the local database and want to get those changes you could use GetChanges() method; AcceptChanges() tells the runtime that the current set of changes has been processed so it advances the sent anchor to cover them. These APIs are very useful to make use of the SqlCe change tracking logic.

    Thanks

    Monday, March 19, 2007 3:46 PM
  • The CTP has serious integration issues with SSMS and SSMSX. See Orcas March 2007 CTP Installation Problems and Orcas March CTP on Vista Database Connections Problem Solved. The latter post deals with a different SSCE versioning problem.

    --rj

     

    Monday, March 19, 2007 4:09 PM