Answered by:
SqlCEProvider with Batching

Question
-
Hi,
I am new to Sync Framework, I was using the SqlCESync provider which came with the framework. But I found that it does not support batching. My question is can I write a SqlCe custom provider using un managed code? since the core API uses IUnknown.
But I couldn't find any samples how use those API. Can someone give me a starting point with un managed code?
Ganesh
Thursday, May 19, 2011 3:46 PM
Answers
-
unfortunately we don't have a good solution in the current release to satisfy this case which the batching is baesd on # of records being synced. the best way you can try is probably to make a best guess on # of rows can fit into the batch size and set the size in that way.
thanks
Yunwen
This posting is provided "AS IS" with no warranties, and confers no rights.- Proposed as answer by Yunwen Bai Wednesday, June 1, 2011 3:06 PM
- Marked as answer by Yunwen Bai Friday, June 3, 2011 2:17 PM
Wednesday, June 1, 2011 3:06 PM
All replies
-
are you referring to SqlCEClientSyncProvider or SqlCeSyncProvider?Thursday, May 19, 2011 11:29 PM
-
Yes, which comes as part of the SyncFrameworkFriday, May 20, 2011 3:40 AM
-
they are different providers. the SqlCeSyncProvider has the MemoryDataCacheSize property that enables batching.Friday, May 20, 2011 4:11 AM
-
what do you want to achieve for your unmanaged provider for SqlCe ?
thanks
Yunwen
This posting is provided "AS IS" with no warranties, and confers no rights.Monday, May 23, 2011 7:43 PM -
I want to implement batching. As JuneT said, SqlCeSyncProvider supports memory batching, I want to have a DB level batching, like read 100 new records and Sync and the next 100. Likwise.
Is there a easy way of doig this ?
Ganesh
Monday, May 30, 2011 5:27 AM -
unfortunately we don't have a good solution in the current release to satisfy this case which the batching is baesd on # of records being synced. the best way you can try is probably to make a best guess on # of rows can fit into the batch size and set the size in that way.
thanks
Yunwen
This posting is provided "AS IS" with no warranties, and confers no rights.- Proposed as answer by Yunwen Bai Wednesday, June 1, 2011 3:06 PM
- Marked as answer by Yunwen Bai Friday, June 3, 2011 2:17 PM
Wednesday, June 1, 2011 3:06 PM -
Hi,
You are saying SqlCeSyncProvider which is provided by MS will do only memory batching, no record level batching. My question is can I write my own provider MyCeSyncProvider using unmanaged code to cater my requirement ?
Ganesh
Thursday, June 16, 2011 12:27 PM -
if it helps without writing a new provider, you can intercept the changes in the ChangesSelected event and trim the rows based on your batching and just send over that batch. You will have to set the LastSentAnchor yourself though. (expensive still though if you have many rows..ie., the select retrieves 1000 rows and you only send 100...then select retrieves 900 and you send 100 again... and so on...) or you can just retrieve the rows once but send them by batch...Thursday, June 16, 2011 2:06 PM