Answered by:
Sync doesn't work until reinitialize the connection

Question
-
I’m using sync framework to perform synchronization between a windows mobile device and a server.
I’m using SQL Compact 3.5 SP2 and Microsoft Sync framework 2.1.
I have an already open sqlce connection to add records to the client tables. When I add records to the client table and Sync, It uploads to the server, but when I add a record again and sync, it doesn’t upload and doesn’t identify the change. If I reinitialize the sqlce connection after the first sync then it works fine. But according to the application the connection reset is not a good solution since it is being used by other modules as well. Is there an alternative solution to this without re initializing the database connection?
Wednesday, May 4, 2011 11:55 AM
Answers
-
Hi,
We have tested similar scenarios with keeping opened connection and didn't see this problem. Plese open a different connection and check if you can view the second set of changes after the initial sync.
Also, only Sync Services for ADO.net for desktops v1 and Sync Services for ADO.net for devices v1 SP1 works for mobile device. You should not use SyncFx 2.1 for it. If you run Sync Services for ADO.net for devices v1 SP1 on mobile device, and SyncFx 2.1 on desktop, it is not the scenario that SyncFx design to support.
Here are the links to download the Sync service for ADO.Net v1:
Mahesh has pointed it in another forum thread as well:
Thanks,
Dong
This posting is provided AS IS with no warranties, and confers no rights.- Proposed as answer by Dong CaoMicrosoft employee Thursday, May 5, 2011 11:19 PM
- Marked as answer by Dong CaoMicrosoft employee Sunday, May 8, 2011 12:42 AM
Thursday, May 5, 2011 11:19 PM
All replies
-
Hi,
We have tested similar scenarios with keeping opened connection and didn't see this problem. Plese open a different connection and check if you can view the second set of changes after the initial sync.
Also, only Sync Services for ADO.net for desktops v1 and Sync Services for ADO.net for devices v1 SP1 works for mobile device. You should not use SyncFx 2.1 for it. If you run Sync Services for ADO.net for devices v1 SP1 on mobile device, and SyncFx 2.1 on desktop, it is not the scenario that SyncFx design to support.
Here are the links to download the Sync service for ADO.Net v1:
Mahesh has pointed it in another forum thread as well:
Thanks,
Dong
This posting is provided AS IS with no warranties, and confers no rights.- Proposed as answer by Dong CaoMicrosoft employee Thursday, May 5, 2011 11:19 PM
- Marked as answer by Dong CaoMicrosoft employee Sunday, May 8, 2011 12:42 AM
Thursday, May 5, 2011 11:19 PM -
Hi,
I have used a different connection and it is working fine. But according to the requirement ,I should use the available storage class to add records.
The table creation ,adding records everything is done using this class and it keeps a open connection through the entire application.I tried using ADO.net for desktops v1as well but still I'm getting the same problem.
Monday, May 9, 2011 5:41 AM -
is the connection open already before you enabled Sync Framework?Monday, May 9, 2011 7:30 AM
-
Yes.Monday, May 9, 2011 7:39 AM
-
there is a known issue before where Change Tracking is not recognized as enabled which requires the connection to be closed and re-opened for it to recognize that Change tracking is enabled.
just google it around or search in the forums...i cant find the most recent post about it except for this one way back in 2009 : http://blogs.msdn.com/b/sidharth/archive/2009/04/23/change-tracking-fails-for-sqlce-version-3-5-5692-1.aspx
but i do remember it being posted not too long ago.
Monday, May 9, 2011 8:27 AM -
Monday, May 9, 2011 8:30 AM